[LARTC] Incoming trafic shaping (depending on src IP)

Linux Advanced Routing and Traffic Control

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

 




Hi there,



i'm trying to shape incoming trafic on my linux box.


I want it to depend on the source IP adress of the packets (in fact, i got a VPN on an ADSL link and wanted to get at least/max 64Kbit/s for the VPN)

So i tried this :

tc qdisc add dev ppp0 root handle 1:0 cbq bandwidth 512Kbit avpkt 1000 cell 8
tc class add dev ppp0 parent 1:0 classid 1:1 cbq bandwidth 512Kbit rate 512Kbit weight 50Kbit prio 8 allot 1514 cell 8 maxburst 20 avpkt 1000
tc class add dev ppp0 parent 1:1 classid 1:10 cbq bandwidth 512Kbit rate 64Kbit weight 6Kbit prio 8 allot 1514 cell 8 maxburst 20 avpkt 1000 bounded isolated
tc qdisc add dev ppp0 parent 1:10 tbf rate 64Kbit buffer 10Kb/8 limit 15Kb mtu 1500
tc filter add dev ppp0 parent 1:0 protocol ip prio 100 u32 match ip src <the SRC IP of my VPN> flowid 1:10


Okay, so, with this, packets comming trought ppp0 and from <the SRC IP of my VPN> should be shaped at 64Kbit/s, right ?

Where's my error ? Is there something more simple (eg. with iptables and packet marking ?)


thx for help :) ____________________________________ 'Spyou' - www.spyou.org - root@xxxxxxxxx #gtr / ircnet.grolier.net - UIN : 6871374

We've done so much, for so long, with so little
We're now qualified to do anything with nothing.




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