Networking Forums

Networking Forums > Computer Networking > Linux Networking > Iptables / tc / QOS

Reply
Thread Tools Display Modes

Iptables / tc / QOS

 
 
Leon
Guest
Posts: n/a

 
      04-24-2007, 09:06 PM
Hi All,

I also posted this in alt.comp.networking.firewalls but as it see's few
posts I thought I would ask here also.

Im looking for some advice on something im trying to implement on a
network gateway.

There is one machine which I would like to throttle it's bandwidth. I
have marked all traffic from that IP address using iptables and I can
see the packets being marked.

The tc rules should allow any traffic a maximum transfer rate of
500kbit/s unless it comes from the marked traffic which should be
limited to 25kbit/s. The rules below work in a sense !

I can adjust the speed any traffic can browse by altering the classid
1:10 row (altering 500 to 100 for example). So the limiting does work.
but only for all clients. It doesn't appear to pick up on the marked
traffic.

I'd be really grateful if someone is able to shed some light on this for me.

Regards,

Leon

iptables -t mangle -F PREROUTING

iptables -t mangle -A PREROUTING -j CONNMARK --restore-mark
iptables -A PREROUTING -t mangle -p tcp -s 10.24.4.5 -j MARK --set-mark 0x29
iptables -A POSTROUTING -t mangle -j CONNMARK --save-mark


tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1: htb default 10
tc class add dev eth0 parent 1: classid 1:1 htb rate 512kbit ceil 512kbit
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 500kbit ceil
500kbit prio 0
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 25kbit ceil
25kbit prio 1
tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10
tc filter add dev eth0 parent 1: protocol ip handle 0x29 fw classid 1:20
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
about iptables junaidaslam Linux Networking 3 08-29-2005 09:35 PM
Looking for iptables applications code (iptables.c) to run some rules to forward packets tvnaidu@yahoo.com Linux Networking 2 01-17-2005 05:01 PM
iptables Bernd Roth Linux Networking 5 01-16-2005 05:53 PM
iptables and nat Marcin Giedz Linux Networking 5 07-06-2004 07:05 AM
iptables "can't initialize iptables table `filter'" pete Linux Networking 1 10-10-2003 03:44 AM



1 2 3 4 5 6 7 8 9 10 11