controlling the bandwidth using tc

Posted by Supratik on Server Fault See other posts from Server Fault or by Supratik
Published on 2011-01-30T15:11:20Z Indexed on 2011/01/30 15:27 UTC
Read the original article Hit count: 206

Filed under:
|

Hi

I have two NIC etho is connected to the internet and eth1 is connected to the LAN.

I want to restrict the download limit using iptables and linux tc.

So I wrote a test script to verify if it is working.

My iptables configuration is as below.

iptables -t mangle -N INBOUND

iptables -t mangle -I PREROUTING -i eth0 -j INBOUND

iptables -t mangle -A INBOUND -j MARK --set-mark 60

My ingress configuration is as below.

tc qdisc add dev eth0 handle 1: ingress

tc filter add dev eth0 parent 1: protocol ip prio 1 handle 60 fw police rate 100kbit burst 20kbit drop flowid :1

Can you please tell me what I am missing here ?

© Server Fault or respective owner

Related posts about iptables

Related posts about tc