This is a discussion on HTB + NAT on Debian (outgoing traffic shaping problems) within the Linux Networking forums, part of the Linux Forums category; hello, I'm running Debian Woody with 2.4.26 kernel. I have 3 NIC: eth0 - 192.168.0.0 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
hello,
I'm running Debian Woody with 2.4.26 kernel. I have 3 NIC: eth0 - 192.168.0.0 subnet eth1 - 192.168.2.0 subnet eth2 - DSL link there are ~5 computers in every subnet and I want them to get equal incoming and outgoing traffic with possibility to borrow unused channel. I have successfully used htb.init to shape my incoming traffic but I ran into problems with outgoing. I try to mark outgoing packets with iptables, but it doesn't work... I do marking like this: iptables -t mangle -A PREROUTING -s 192.168.2.10 -j MARK --set-mark 101 then NAT: $IPT -t nat -A POSTROUTING -s $FRIEND -j SNAT --to $IP_BLUE then in sysconfig: cat ./eth2 DEFAULT=2 cat ./eth2-2.root # root class containing total bandwidth RATE=320Kbit MTU=300 cat ./eth2-2\:101.madcrock RATE=1Kbit MARK=101 LEAF=sfq I try to shape myself down to 1Kbit but during upload I get 2 and more Kb/s... Please help me to solve this problem. Thanks in advance, Laurynas |
|
|||
|
On Wed, 12 May 2004 05:17:27 -0700, Laurynas Butkus wrote:
> hello, > > I'm running Debian Woody with 2.4.26 kernel. I have 3 NIC: eth0 - > 192.168.0.0 subnet > eth1 - 192.168.2.0 subnet > eth2 - DSL link > > there are ~5 computers in every subnet and I want them to get equal > incoming and outgoing traffic with possibility to borrow unused channel. > > I have successfully used htb.init to shape my incoming traffic but I ran > into problems with outgoing. I try to mark outgoing packets with > iptables, but it doesn't work... > > I do marking like this: > iptables -t mangle -A PREROUTING -s 192.168.2.10 -j MARK --set-mark 101 > > then NAT: > $IPT -t nat -A POSTROUTING -s $FRIEND -j SNAT --to $IP_BLUE > > then in sysconfig: > > cat ./eth2 > DEFAULT=2 > > cat ./eth2-2.root > # root class containing total bandwidth RATE=320Kbit MTU=300 > > cat ./eth2-2\:101.madcrock > RATE=1Kbit > MARK=101 > LEAF=sfq > > I try to shape myself down to 1Kbit but during upload I get 2 and more > Kb/s... > Please help me to solve this problem. > > Thanks in advance, > Laurynas I don't know about the scripts that you are using but here are a few general things. HTB is not recomemded for these 1Kbit stuff. For that use cbq. Traffic control is implimented by: a) Classes : These are the transmission classes which send the data out. $TC qdisc add dev $EXT root handle 1:0 cbq $AVPKT $BW $TC class add dev $EXT parent 1:0 classid 1:1 cbq rate 300kbit $ALLOT prio 5 $AV PKT $BW bounded isolated $TC class add dev $EXT parent 1:1 classid 1:10 cbq rate 220kbit $ALLOT prio 5 $A VPKT mpu 64 maxburst 40 $BW weight 1000kbit isolated b) Queues: These are queues, one to EACH class that you created. If you did not specify a particular type of queue, it will use FIFO. A class will get it's packets from its associated queue. $TC qdisc add dev $EXT parent 1:10 sfq perturb 10 quantum 1492 c) Filters: These are rules that identify a packet and send it to a particular class-queue combination (called a "flowid"). "fw" tells it to use the mark on the packet. $TC filter add dev $EXT parent 1:0 protocol IP prio 10 handle $DEFAULT fw flowid 1:10 Without filters, it won't work. |