All pastes #810341 Raw Edit

moonwatcher

public text v1 · immutable
·published 2007-12-09 21:15 UTC
rendered paste body
root@PortoDelGato:~# cat /etc/config/qos 
# QoS configuration for OpenWrt

# INTERFACES:
config interface wan
        option classgroup  "Default"
        option enabled      1
        option overhead     1
        option upload       512
        option download     1512

# RULES:
config classify
        option target       "Bulk"
        option ipp2p        "all"
config classify
        option target       "Bulk"
        option layer7       "edonkey"
config classify
        option target       "Bulk"
        option layer7       "bittorrent"
config classify
        option target       "Priority"
        option ports        "22,53,3389,3390,3391,22120,21120"
        option pktsize      "-256"
config classify
        option target       "Normal"
        option proto        "tcp"
        option ports        "20,21,25,80,110,443,993,995"
config classify
        option target       "Express"
        option proto        "udp"
        option portrange    "49645-49648"
        option pktsize      "1024"
config default
        option target       "Express"
        option proto        "udp"
        option pktsize      "-512"
config reclassify
        option target       "Priority"
        option proto        "icmp"
config default
        option target       "Bulk"
        option portrange    "1024-65535"
config reclassify
        option target       "Priority"
        option proto        "tcp"
        option pktsize      "-128"
        option mark         "!Bulk"
        option tcpflags     "SYN"
config reclassify
        option target       "Priority"
        option proto        "tcp"
        option pktsize      "-128"
        option mark         "!Bulk"
        option tcpflags     "ACK"

config reclassify
        option target       "Express"
        option layer7       "edonkey-dl"
        option limit        "8"
        option pktsize      "-128"

config reclassify                                     
        option target       "Express"    
        option ports        "21" 
        option limit        "10"          
        option pktsize      "-512"     
# Don't change the stuff below unless you
# really know what it means :)

config classgroup "Default"
        option classes      "Priority Express Normal Bulk"
        option default      "Normal"


config class "Priority"
        option packetsize  400
        option maxsize     400
        option avgrate     10
        option priority    20
config class "Priority_down"
        option packetsize  1000
        option avgrate     10


config class "Express"
        option packetsize  1000
        option maxsize     800
        option avgrate     50
        option priority    10

config class "Normal"
        option packetsize  1500
        option packetdelay 100
        option avgrate     10
        option priority    5
config class "Normal_down"
        option avgrate     20

config class "Bulk"
        option avgrate     1
        option packetdelay 200
root@PortoDelGato:~# 



root@PortoDelGato:~# iptables -L -v  -t mangle
Chain Default (4 references)
 pkts bytes target     prot opt in     out     source               destination         
 5780  752K CONNMARK   all  --  any    any     anywhere             anywhere            CONNMARK restore 
 3404  337K Default_ct  all  --  any    any     anywhere             anywhere            MARK match 0x0 
  164  183K MARK       all  --  any    any     anywhere             anywhere            MARK match 0x1 length 400:65535 MARK set 0x0 
    0     0 MARK       all  --  any    any     anywhere             anywhere            MARK match 0x2 length 800:65535 MARK set 0x0 
 2494  238K MARK       udp  --  any    any     anywhere             anywhere            MARK match 0x0 length 0:512 MARK set 0x2 
  126 19252 MARK       icmp --  any    any     anywhere             anywhere            MARK set 0x1 
  764 89370 MARK       tcp  --  any    any     anywhere             anywhere            MARK match 0x0 tcp spts:1024:65535 dpts:1024:65535 MARK set 0x4 
    2  1339 MARK       udp  --  any    any     anywhere             anywhere            MARK match 0x0 udp spts:1024:65535 dpts:1024:65535 MARK set 0x4 
   26  1456 MARK       tcp  --  any    any     anywhere             anywhere            length 0:128 MARK match !0x4 tcp flags:FIN,SYN,RST,PSH,ACK,URG/SYN MARK set 0x1 
  847 40996 MARK       tcp  --  any    any     anywhere             anywhere            length 0:128 MARK match !0x4 tcp flags:FIN,SYN,RST,PSH,ACK,URG/ACK MARK set 0x1 
    6   545 MARK       all  --  any    any     anywhere             anywhere            LAYER7 l7proto edonkey-dl l7pkt limit: avg 8/sec burst 5 length 0:128 MARK set 0x2 
    0     0 MARK       tcp  --  any    any     anywhere             anywhere            tcp multiport ports 21 limit: avg 10/sec burst 5 length 0:512 MARK set 0x2 
    0     0 MARK       udp  --  any    any     anywhere             anywhere            udp multiport ports 21 limit: avg 10/sec burst 5 length 0:512 MARK set 0x2 

Chain Default_ct (1 references)
 pkts bytes target     prot opt in     out     source               destination         
   30  3494 MARK       all  --  any    any     anywhere             anywhere            MARK match 0x0 ipp2p v0.8.1_rc1 --kazaa --gnu --edk --dc --bit MARK set 0x4 
    0     0 MARK       all  --  any    any     anywhere             anywhere            MARK match 0x0 LAYER7 l7proto edonkey MARK set 0x4 
    0     0 MARK       all  --  any    any     anywhere             anywhere            MARK match 0x0 LAYER7 l7proto bittorrent MARK set 0x4 
    4   240 MARK       tcp  --  any    any     anywhere             anywhere            MARK match 0x0 tcp multiport ports 22,53,3389,3390,3391,22120,21120 MARK set 0x1 
    2   122 MARK       udp  --  any    any     anywhere             anywhere            MARK match 0x0 udp multiport ports 22,53,3389,3390,3391,22120,21120 MARK set 0x1 
    3   168 MARK       tcp  --  any    any     anywhere             anywhere            MARK match 0x0 tcp multiport ports 20,21,25,80,110,443,993,995 MARK set 0x3 
    0     0 MARK       udp  --  any    any     anywhere             anywhere            MARK match 0x0 udp spts:49645:49648 dpts:49645:49648 MARK set 0x2 
 3404  337K CONNMARK   all  --  any    any     anywhere             anywhere            CONNMARK save  

Chain PREROUTING (policy ACCEPT 50M packets, 20G bytes)
 pkts bytes target     prot opt in     out     source               destination         
 1582  179K Default    all  --  ppp0   any     anywhere             anywhere            
 1582  179K IMQ        all  --  ppp0   any     anywhere             anywhere            IMQ: todev 0 

Chain INPUT (policy ACCEPT 19M packets, 9071M bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 31M packets, 11G bytes)
 pkts bytes target     prot opt in     out     source               destination         
 1645  168K Default    all  --  any    ppp0    anywhere             anywhere            

Chain OUTPUT (policy ACCEPT 17M packets, 4740M bytes)
 pkts bytes target     prot opt in     out     source               destination         
  454  119K Default    all  --  any    ppp0    anywhere             anywhere            

Chain POSTROUTING (policy ACCEPT 47M packets, 16G bytes)
 pkts bytes target     prot opt in     out     source               destination         
 2099  287K Default    all  --  any    ppp0    anywhere             anywhere            
root@PortoDelGato:~# 


root@PortoDelGato:~# qos-stat 
#################
# EGRESS STATUS #
#################

class hfsc 1: root 
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) 
 period 0 level 2 

class hfsc 1:1 parent 1: sc m1 0bit d 0us m2 498008bit ul m1 0bit d 0us m2 498008bit 
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) 
 period 2052 work 305597 bytes level 1 

class hfsc 1:10 parent 1:1 leaf 100: rt m1 290000bit d 1.6ms m2 49008bit ls m1 290000bit d 1.6ms m2 276000bit ul m1 0bit d 0us m2 498008bit 
 Sent 72434 bytes 735 pkts (dropped 0, overlimits 0) 
 period 704 work 72434 bytes rtwork 58450 bytes level 0 

class hfsc 1:20 parent 1:1 leaf 200: rt m1 265000bit d 3.9ms m2 249000bit ls m1 265000bit d 3.9ms m2 138000bit ul m1 0bit d 0us m2 498008bit 
 Sent 98405 bytes 1088 pkts (dropped 0, overlimits 0) 
 period 967 work 98405 bytes rtwork 85652 bytes level 0 

class hfsc 1:30 parent 1:1 leaf 300: ls m1 0bit d 100.0ms m2 69000bit ul m1 0bit d 0us m2 498008bit 
 Sent 99015 bytes 117 pkts (dropped 0, overlimits 0) 
 period 104 work 99015 bytes level 0 

class hfsc 1:40 parent 1:1 leaf 400: ls m1 0bit d 200.0ms m2 13000bit ul m1 0bit d 0us m2 498008bit 
 Sent 35743 bytes 289 pkts (dropped 0, overlimits 0) 
 period 287 work 35743 bytes level 0 

##################
# INGRESS STATUS #
##################

class hfsc 1: root 
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) 
 period 0 level 2 

class hfsc 1:1 parent 1: sc m1 0bit d 0us m2 1427Kbit ul m1 0bit d 0us m2 1427Kbit 
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) 
 period 1657 work 185655 bytes level 1 

class hfsc 1:10 parent 1:1 leaf 100: rt m1 323008bit d 1.4ms m2 142000bit ls m1 323008bit d 1.4ms m2 792008bit ul m1 0bit d 0us m2 1427Kbit 
 Sent 58672 bytes 822 pkts (dropped 0, overlimits 0) 
 period 822 work 58672 bytes rtwork 57864 bytes level 0 

class hfsc 1:20 parent 1:1 leaf 200: rt m1 743000bit d 1.4ms m2 713000bit ls m1 743000bit d 1.4ms m2 396008bit ul m1 0bit d 0us m2 1427Kbit 
 Sent 60393 bytes 522 pkts (dropped 0, overlimits 0) 
 period 522 work 60393 bytes rtwork 59369 bytes level 0 

class hfsc 1:30 parent 1:1 leaf 300: ls m1 0bit d 100.0ms m2 198008bit ul m1 0bit d 0us m2 1427Kbit 
 Sent 37909 bytes 51 pkts (dropped 0, overlimits 0) 
 period 45 work 37909 bytes level 0 

class hfsc 1:40 parent 1:1 leaf 400: ls m1 0bit d 200.0ms m2 39000bit ul m1 0bit d 0us m2 1427Kbit 
 Sent 28681 bytes 268 pkts (dropped 0, overlimits 0) 
 period 268 work 28681 bytes level 0 

root@PortoDelGato:~#