Re: limiting bandwidth with iptables or squid?

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

 



it clown wrote:
Hi All,

I am abit confused with tc.

I need a string to limit band whidth for ips or mac
addresses.

iptables -A PREROUTING -i eth0 -s x.x.x.x -t mangle -j MARK
--set-mark 1

If you want to shape traffic from the internet to certain IPs there are several ways -
you could mark them on the WAN interface eg. -i ppp0. If you do it in PREROUTING and are doing NAT it won't work for local addresses, though.


If you do not care about shaping traffic headed for your shaping box and you only have one lan interface you can set up HTB/CBQ/HFSC egress on eth0. You could then use POSTROUTING to mark IPs which will be denatted at that point.


will mark the packets for that ip.i think.

what string for tc do i need to limit x.x.x.x to say 5kb/s
download speed? eth0 is my internal network card of my
linux box.



I would use HTB - there are examples and links on www.docum.org / LARTC how to.

You will need to run at about 80% of your link speed.

Andy.



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux