Find the answer to your Linux question:
Results 1 to 1 of 1
Hello, i have little problem somewhere in shaper, there is for example my script: # del Qdisc tc qdisc del dev imq0 root 2> /dev/null tc qdisc del dev imq1 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    1

    IMQ + VLAN 802.1q + HTB


    Hello,
    i have little problem somewhere in shaper, there is for example my script:

    # del Qdisc
    tc qdisc del dev imq0 root 2> /dev/null
    tc qdisc del dev imq1 root 2> /dev/null

    # traffic to IMQ
    iptables -t mangle -A PREROUTING -i eth1 -j shaper_up
    iptables -t mangle -A PREROUTING -i vlan2 -j shaper_up
    iptables -t mangle -A POSTROUTING -o eth1 -j shaper_down
    iptables -t mangle -A POSTROUTING -o vlan2 -j shaper_down
    iptables -t mangle -A shaper_up -j IMQ --todev 0
    iptables -t mangle -A shaper_down -j IMQ --todev 1

    # Marking
    iptables -t mangle -A shaper_up -s 10.122.7.189 -j MARK --set-mark=110
    iptables -t mangle -A shaper_down -d 10.122.7.189 -j MARK --set-mark=110

    iptables -t mangle -A shaper_up -s 10.122.7.211 -j MARK --set-mark=111
    iptables -t mangle -A shaper_down -d 10.122.7.211 -j MARK --set-mark=111

    iptables -t mangle -A shaper_up -s 10.122.6.153 -j MARK --set-mark=140
    iptables -t mangle -A shaper_down -d 10.122.6.153 -j MARK --set-mark=140
    iptables -t mangle -A shaper_up -s 10.128.3.9 -j MARK --set-mark=140
    iptables -t mangle -A shaper_down -d 10.128.3.9 -j MARK --set-mark=140

    iptables -t mangle -A shaper_up -s 10.128.3.36 -j MARK --set-mark=141
    iptables -t mangle -A shaper_down -d 10.128.3.36 -j MARK --set-mark=141

    iptables -t mangle -A shaper_up -s 10.128.2.133 -j MARK --set-mark=200
    iptables -t mangle -A shaper_down -d 10.128.2.133 -j MARK --set-mark=200

    iptables -t mangle -A shaper_up -s 10.128.2.132 -j MARK --set-mark=201
    iptables -t mangle -A shaper_down -d 10.128.2.132 -j MARK --set-mark=201

    iptables -t mangle -A shaper_up -s 10.122.0.120 -j MARK --set-mark=243
    iptables -t mangle -A shaper_down -d 10.122.0.120 -j MARK --set-mark=243

    iptables -t nat -A POSTROUTING -o eth0 -s 10.122.0.0/17 -j MASQUERADE
    iptables -t nat -A POSTROUTING -o eth0 -s 10.128.0.0/16 -j MASQUERADE


    # create Qdisc
    tc qdisc add dev imq0 root handle 1:0 htb r2q 1 default 2
    tc qdisc add dev imq1 root handle 1:0 htb r2q 1 default 2

    # Max root rate
    tc class add dev imq0 parent 1:0 classid 1:1 htb rate 30Mbit
    tc class add dev imq1 parent 1:0 classid 1:1 htb rate 30Mbit

    # backbones
    tc class add dev imq0 parent 1:1 classid 1:10 htb rate 16kbit ceil 30Mbit
    tc class add dev imq1 parent 1:1 classid 1:10 htb rate 16kbit ceil 30Mbit

    tc class add dev imq0 parent 1:1 classid 1:11 htb rate 16kbit ceil 30Mbit
    tc class add dev imq1 parent 1:1 classid 1:11 htb rate 16kbit ceil 30Mbit

    tc class add dev imq0 parent 1:1 classid 1:12 htb rate 16kbit ceil 30Mbit
    tc class add dev imq1 parent 1:1 classid 1:12 htb rate 16kbit ceil 30Mbit

    # Access Points
    tc class add dev imq0 parent 1:10 classid 1:17 htb rate 16kbit ceil 10Mbit
    tc class add dev imq1 parent 1:10 classid 1:17 htb rate 16kbit ceil 10Mbit

    tc class add dev imq0 parent 1:10 classid 1:19 htb rate 16kbit ceil 10Mbit
    tc class add dev imq1 parent 1:10 classid 1:19 htb rate 16kbit ceil 10Mbit

    tc class add dev imq0 parent 1:11 classid 1:22 htb rate 16kbit ceil 5Mbit
    tc class add dev imq1 parent 1:11 classid 1:22 htb rate 16kbit ceil 5Mbit

    tc class add dev imq0 parent 1:12 classid 1:26 htb rate 16kbit ceil 30Mbit
    tc class add dev imq1 parent 1:12 classid 1:26 htb rate 16kbit ceil 30Mbit

    # Klients
    tc class add dev imq0 parent 1:17 classid 1:138 htb rate 16kbit ceil 1200kbit prio 4
    tc filter add dev imq0 parent 1:0 prio 4 protocol ip handle 110 fw flowid 1:138
    tc class add dev imq1 parent 1:17 classid 1:138 htb rate 16kbit ceil 2150kbit prio 4
    tc filter add dev imq1 parent 1:0 prio 4 protocol ip handle 110 fw flowid 1:138

    tc class add dev imq0 parent 1:17 classid 1:139 htb rate 16kbit ceil 1200kbit prio 4
    tc filter add dev imq0 parent 1:0 prio 4 protocol ip handle 111 fw flowid 1:139
    tc class add dev imq1 parent 1:17 classid 1:139 htb rate 16kbit ceil 2150kbit prio 4
    tc filter add dev imq1 parent 1:0 prio 4 protocol ip handle 111 fw flowid 1:139

    tc class add dev imq0 parent 1:19 classid 1:168 htb rate 16kbit ceil 1200kbit prio 4
    tc filter add dev imq0 parent 1:0 prio 4 protocol ip handle 140 fw flowid 1:168
    tc class add dev imq1 parent 1:19 classid 1:168 htb rate 16kbit ceil 2150kbit prio 4
    tc filter add dev imq1 parent 1:0 prio 4 protocol ip handle 140 fw flowid 1:168

    tc class add dev imq0 parent 1:19 classid 1:169 htb rate 16kbit ceil 1200kbit prio 4
    tc filter add dev imq0 parent 1:0 prio 4 protocol ip handle 141 fw flowid 1:169
    tc class add dev imq1 parent 1:19 classid 1:169 htb rate 16kbit ceil 2150kbit prio 4
    tc filter add dev imq1 parent 1:0 prio 4 protocol ip handle 141 fw flowid 1:169

    tc class add dev imq0 parent 1:22 classid 1:228 htb rate 16kbit ceil 1200kbit prio 4
    tc filter add dev imq0 parent 1:0 prio 4 protocol ip handle 200 fw flowid 1:228
    tc class add dev imq1 parent 1:22 classid 1:228 htb rate 16kbit ceil 2150kbit prio 4
    tc filter add dev imq1 parent 1:0 prio 4 protocol ip handle 200 fw flowid 1:228

    tc class add dev imq0 parent 1:22 classid 1:229 htb rate 16kbit ceil 1200kbit prio 4
    tc filter add dev imq0 parent 1:0 prio 4 protocol ip handle 201 fw flowid 1:229
    tc class add dev imq1 parent 1:22 classid 1:229 htb rate 16kbit ceil 2150kbit prio 4
    tc filter add dev imq1 parent 1:0 prio 4 protocol ip handle 201 fw flowid 1:229

    tc class add dev imq0 parent 1:26 classid 1:271 htb rate 16kbit ceil 30000kbit prio 4
    tc filter add dev imq0 parent 1:0 prio 4 protocol ip handle 243 fw flowid 1:271
    tc class add dev imq1 parent 1:26 classid 1:271 htb rate 16kbit ceil 30000kbit prio 4
    tc filter add dev imq1 parent 1:0 prio 4 protocol ip handle 243 fw flowid 1:271


    eth0 - internet
    eth1 and vlan2 (vlan2 is on eth1) - my network

    Everything looks like perfect
    users speed test show 2Mbps download and 1Mbps upload...
    I with IP 10.122.0.120 have 25Mbps upload and 25Mbps download...
    But when i start downloading and uploading in same time so my download
    is 15Mbps and Upload 10Mbps :-/
    Now i have nice half-duflex shaper, but i need full-duplex (25Mbps
    upload and 25Mbps download in same time)

    Can anybody help me?

    Thank You for whatever idea...
    Last edited by coolex; 08-26-2008 at 07:06 PM. Reason: estetick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •