Shape it baby on a bridge...
Hello all.
I'm having some weird problem setting up a Linux bridge as a shaper.
Bridge setup:
br0 -> eth0.412 & eth0.413
Shaper:
#!/bin/bash
TC=/sbin/tc
EBTABLES=/sbin/ebtables
$TC qdisc add dev eth0.412 root handle 1:0 cbq bandwidth 100Mbit avpkt 1000 mpu 64
$TC qdisc add dev eth0.413 root handle 1:0 cbq bandwidth 100Mbit avpkt 1000 mpu 64
#1kbps download speed
${TC} class add dev eth0.412 parent 1:0 classid 1:1 cbq rate 1KBit allot 1514 prio 1 avpkt 1000 bounded weight 1KBit
${TC} filter add dev eth0.412 parent 1:0 protocol ip handle 1 fw flowid 1:1
${EBTABLES} -A FORWARD -p IPv4 --ip-destination 192.168.36.34 -d 00:0B:CD:F0:1A:97 -j mark --set-mark 1 --mark-target ACCEPT
#1kbps upload speed
${TC} class add dev eth0.413 parent 1:0 classid 1:1 cbq rate 1KBit allot 1514 prio 1 avpkt 1000 bounded weight 1KBit
${TC} filter add dev eth0.413 parent 1:0 protocol ip handle 1 fw flowid 1:1
${EBTABLES} -A FORWARD -p IPv4 --ip-source 192.168.36.34 -s 00:0B:CD:F0:1A:97 -j mark --set-mark 1 --mark-target ACCEPT
This script doesn't seem to do anything. :confused:
Your ideas are greatly appreciated.
Zerth.
Edit: ->
[root@testpc init.d]# ebtables -L
Bridge table: filter
Bridge chain: INPUT, entries: 0, policy: ACCEPT
Bridge chain: FORWARD, entries: 2, policy: ACCEPT
-p IPv4 -d 0:b:cd:f0:1a:97 --ip-dst 192.168.36.34 -j mark --mark-set 0x1 --mark-target ACCEPT
-p IPv4 -s 0:b:cd:f0:1a:97 --ip-src 192.168.36.34 -j mark --mark-set 0x1 --mark-target ACCEPT
Bridge chain: OUTPUT, entries: 0, policy: ACCEPT
[root@testpc init.d]# tc class show dev eth0.412
class cbq 1: root rate 100000Kbit (bounded,isolated) prio no-transmit
class cbq 1:1 parent 1: rate 1000bit (bounded) prio 1
[root@testpc init.d]# tc class show dev eth0.413
class cbq 1: root rate 100000Kbit (bounded,isolated) prio no-transmit
class cbq 1:1 parent 1: rate 1000bit (bounded) prio 1
[root@testpc init.d]# tc filter show dev eth0.412
filter parent 1: protocol ip pref 49152 fw
filter parent 1: protocol ip pref 49152 fw handle 0x1 classid 1:1
[root@testpc init.d]# tc filter show dev eth0.413
filter parent 1: protocol ip pref 49152 fw
filter parent 1: protocol ip pref 49152 fw handle 0x1 classid 1:1
Edit: ->
[root@testpc init.d]# lsmod |grep eb
ebt_mark 5825 2
ebt_ip 6337 2
ebt_log 8257 2
ebtable_filter 6593 1
ebtables 22465 4 ebt_mark,ebt_ip,ebt_log,ebtable_filter
Jul 10 16:30:48 testpc kernel: IN=eth0.413 OUT=eth0.412 MAC source = 00:19:2f:0d:6f:e0 MAC dest = 00:0b:cd:f0:1a:97 proto = 0x0800 IP SRC=155.195.82.25 IP DST=192.168.36.34, IP tos=0x40, IP proto=1
Jul 10 16:30:49 testpc kernel: IN=eth0.412 OUT=eth0.413 MAC source = 00:0b:cd:f0:1a:97 MAC dest = 00:19:2f:0d:6f:e0 proto = 0x0800 IP SRC=192.168.36.34 IP DST=155.195.82.25, IP tos=0x00, IP proto=1
Jul 10 16:30:49 testpc kernel: IN=eth0.413 OUT=eth0.412 MAC source = 00:19:2f:0d:6f:e0 MAC dest = 00:0b:cd:f0:1a:97 proto = 0x0800 IP SRC=155.195.82.25 IP DST=192.168.36.34, IP tos=0x40, IP proto=1
Jul 10 16:30:50 testpc kernel: IN=eth0.412 OUT=eth0.413 MAC source = 00:0b:cd:f0:1a:97 MAC dest = 00:19:2f:0d:6f:e0 proto = 0x0800 IP SRC=192.168.36.34 IP DST=155.195.82.25, IP tos=0x00, IP proto=1
Jul 10 16:30:50 testpc kernel: IN=eth0.413 OUT=eth0.412 MAC source = 00:19:2f:0d:6f:e0 MAC dest = 00:0b:cd:f0:1a:97 proto = 0x0800 IP SRC=155.195.82.25 IP DST=192.168.36.34, IP tos=0x40, IP proto=1