Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Im currently working on a traffic shaping in linux. We have a client connected to a server running nat and dhcp. What we want to do is limit both the upload and download speed of the client/clients.

However only download limit works.

Download limit(Part of the script) WORKING

tc class add dev eth1 parent 1:1 classid 1:4 htb rate 30000kbit
tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32 match ip dst 192.168.0.101/32 flowid 1:4

Upload limit(Part of the script)

tc class add dev eth1 parent 1:1 classid 1:4 htb rate 30000kbit
tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32 match ip src 192.168.0.101/32 flowid 1:4

The only thing that is changed in the upload part is "dst" to "src" Problem is when we replace the download part of the script with the upload part, no limiting is done.? what is wrong

Edited after David Schwartz answered me:

My qdisc that i used both upload and download limiting on.

tc qdisc add dev eth1 root handle 1: htb default 30

Qdisc i am adding now

tc qdisc add dev eth1 ingress
share|improve this question
add comment

1 Answer

If the download limit is working, it must be connected to the egress qdisc, since it's an egress rule. If you attach the upload script to the same qdisc, as your identical parent statements indicate, then would mean that it is attached to the egress qdisc as well. That clearly makes no sense, since it's an ingress limit.

Also, I'm pretty sure htb is not a supported ingress qdisc. Can you paste a link to the documentation you were following?

share|improve this answer
    
Ah! I see! Thank you for informing me. I thought it worked the same way on uploads and downloads. Clearly i was mistaken. I originaly only had one qdisk root. I dont know how ingresse qdisc works but clearly you have pointed me in the right direction! Link to the page were i got my previous information (that one is to limit your own computer but i did not find anyone about limiting clients computers so i thought i could make use of this somehow): iplocation.net/tools/traffic-control.php –  martio09 Apr 16 '13 at 13:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.