Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. 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

share|improve this question
    
From your description, I can say that 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 use tcpdump to trace it. –  Khaled Apr 16 '13 at 11:58
    
I have tried using wireshark and i can confirm that packets are registered (on eth1 interface, that is the LAN interface,) with the right ip adresse. Dst and src are 192.168.0.101 when reciving and sending packets. –  martio09 Apr 16 '13 at 12:44

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.