traffic shaping help

Linux Advanced Routing and Traffic Control

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

 



I'm trying to shape bandwidth but with no success.

I have a Linux server with 3 networks (WAN, LAN and DMZ). In the DMZ I
have a server (IP 172.21.1.2) that I wish to grant a 25kbit bandwidth
(from a total of 256kbit coming from the WAN). To accomplish this, I
setup Linux to allow the use of IMQ devices. I wrote the following
script (eth1 is WAN, eth2 is DMZ):

#!/bin/sh
modprobe imq numdevs=1
tc qdisc add dev imq0 root handle 1: htb default 20 r2q 1
tc class add dev imq0 parent 1: classid 1:1 htb rate 256kbit ceil
256kbit
tc class add dev imq0 parent 1:1 classid 1:10 htb rate 25kbit ceil
256kbit
tc class add dev imq0 parent 1:1 classid 1:20 htb rate 231kbit ceil
256kbit
tc filter add dev imq0 protocol ip parent 1:0 prio 1 u32 match ip src
172.21.1.2 flowid 1:10
tc filter add dev imq0 protocol ip parent 1:0 prio 2 u32 match ip dst
172.21.1.2 flowid 1:10
iptables -t mangle -A POSTROUTING -o eth1 -j IMQ --todev 0
iptables -t mangle -A POSTROUTING -o eth2 -j IMQ --todev 0
iptables -t mangle -A PREROUTING -i eth2 -j IMQ --todev 0


The output of 'tc -s -d qdisc ls dev imq0' is:

qdisc htb 1: r2q 1 default 20 direct_packets_stat 0 ver 3.10
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

This output is after running the script for a while, the statistics
shouldn't be 0, should they?


Anybody know what I did wrong? Any help will be appreciated :)


Toshiro.


-- 
Toshiro Viera <tviera@xxxxxxxxxxxxxxxxxxxx>

_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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