script for limiting uploaddoes not work

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, I want only a very simple thing, but somehow I cannot manage to get it working. I would like to shape download and upload speeds of my DC++ client firmly to some speed, but I cannot make the upload part working. I use a linux router (asus wl500g, actually), and a NATed PC (adress 192.168.1.100)
eth1 is my WAN interface, br0 is LAN, DC++ is active and running on ports(udp and tcp) 4111.
This is my script (working) for download:
iptables -t mangle -A FORWARD -p tcp --dport 4111 -j MARK --set-mark 1
tc qdisc add dev br0 root handle 1:0 htb default 0
tc class add dev br0 parent 1:0 classid 1:1 htb rate 1024kbit
tc class add dev br0 parent 1:1 classid 1:11 htb rate 256kbit
tc filter add dev br0 parent 1:0 protocol ip handle 1 fw flowid 1:11
I thought that upload would be very similar:
iptables -t mangle -A FORWARD -p tcp --sport 4111 -j MARK --set-mark 2
tc qdisc add dev eth1 root handle 2:0 htb default 0
tc class add dev eth1 parent 2:0 classid 2:1 htb rate 1024kbit
tc class add dev eth1 parent 2:1 classid 2:11 htb rate 256kbit
tc filter add dev eth1 parent 2:0 protocol ip handle 2 fw flowid 2:11
but it does not work. 
tc part is actually ok, because if I type this:
iptables -t mangle -A FORWARD -i br0 -j MARK --set-mark 2
or this:
iptables -t mangle -D FORWARD -s 192.168.1.100 -j MARK --set-mark 2
upload goes to 64kbit, but do does everything else too - which is not exactly what I am trying to do:-). So the problem si something with marking and iptables - any ideas? (or even a completle different approach to the problem then marking packets?) Thanks for help in advance.
Tomas
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux