Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an Ubuntu 10 box that I'm trying to set up as a bandwidth-shaping router.

The machine has one WAN interface, eth0 and two LAN interfaces, eth1 and eth2. NAT is configured using MASQUERADE as described at InternetConnectionSharing.

I'm mostly concerned with shaping outbound traffic from the LAN interfaces -- in the end, I'd like to end up with a hard 768Kbps limit per-LAN-interface (rather than a limit on eth0 pooled across all interfaces).

I installed HTB.init, and riffing on the examples, tried to set this up on eth1 by putting three files into /etc/sysconfig/htb:

/etc/sysconfig/htb/eth1

DEFAULT=30
R2Q=100

/etc/sysconfig/htb/eth1-2.root

RATE=768Kbps
BURST=15k

/etc/sysconfig/htb/eth1-2:30.dfl

RATE=768Kbps
CEIL=788Kbps
BURST=15k
LEAF=sfq

I can /etc/init.d/htb start and /etc/init.d/htb stats and see information that /seems/ to suggest it's working...but when I try pulling a large file via the WAN interface the shaping clearly isn't in effect.

Any suggestions? My guess is it has something to do with where the shaping falls in the NAT chain, but I really have no idea where to begin troubleshooting this.

---- Update:

Here's my /etc/init.d/htb list output, it seems to make sense -- the default rate for eth1 is 768Kbps?

### eth0: queueing disciplines

qdisc htb 1: root refcnt 2 r2q 100 default 30 direct_packets_stat 0
qdisc sfq 30: parent 1:30 limit 127p quantum 1514b perturb 10sec 

### eth0: traffic classes

class htb 1:2 root rate 768000bit ceil 768000bit burst 1599b cburst 1599b 
class htb 1:30 parent 1:2 leaf 30: prio 0 rate 6144Kbit ceil 6144Kbit burst 15Kb cburst 1598b 

### eth0: filtering rules

filter parent 1: protocol ip pref 100 u32 
filter parent 1: protocol ip pref 100 u32 fh 800: ht divisor 1 
filter parent 1: protocol ip pref 100 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:30 
  match 00000000/00000000 at 12
  match 00000000/00000000 at 16

### eth1: queueing disciplines

qdisc htb 1: root refcnt 2 r2q 100 default 30 direct_packets_stat 0
qdisc sfq 30: parent 1:30 limit 127p quantum 1514b perturb 10sec 

### eth1: traffic classes

class htb 1:2 root rate 768000bit ceil 768000bit burst 1599b cburst 1599b 
class htb 1:30 parent 1:2 leaf 30: prio 0 rate 6144Kbit ceil 6144Kbit burst 15Kb cburst 1598b 
share|improve this question
add comment

1 Answer

Try adding this (using your IP) to eth1-2:30.dfl

RULE=192.168.0.0/24
share|improve this answer
    
No luck, still the same result. Let me post my htb config, maybe that will give some clues? –  Ben K. Jan 28 '11 at 17:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.