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
192.168.0.101
should be the client IP. That's fine. You said there is NATing in your setup. You need to confirm the IP address seen by your server on the right interface. If you are unsure, you can usetcpdump
to trace it.