summaryrefslogtreecommitdiff
path: root/polux/application/iproute2/examples/sarft/ebtables_htb
diff options
context:
space:
mode:
Diffstat (limited to 'polux/application/iproute2/examples/sarft/ebtables_htb')
-rwxr-xr-xpolux/application/iproute2/examples/sarft/ebtables_htb23
1 files changed, 23 insertions, 0 deletions
diff --git a/polux/application/iproute2/examples/sarft/ebtables_htb b/polux/application/iproute2/examples/sarft/ebtables_htb
new file mode 100755
index 0000000000..a34dcd1985
--- /dev/null
+++ b/polux/application/iproute2/examples/sarft/ebtables_htb
@@ -0,0 +1,23 @@
+#! /bin/sh
+# Test -1 master two slaves-
+# 1 slave receives up to 4Mbit, data for the other slave 50-80Mbit should stop reception
+# for the first one if marked with higher number
+# marking done in ebtables according to mac addresses
+
+tc qdisc del dev plc0 root handle 1:0
+ebtables --init-table
+
+tc qdisc add dev plc0 root handle 1:0 htb default 4
+#htb queue discipline with 3 leafes, same parent, all 3 can borrow from each other
+tc class add dev plc0 parent 1:0 classid 1:1 htb rate 20Mbit ceil 20Mbit
+tc class add dev plc0 parent 1:1 classid 1:2 htb rate 1Kbit ceil 4Mbit prio 1 burst 1k
+tc class add dev plc0 parent 1:1 classid 1:3 htb rate 15Mbit ceil 20Mbit prio 0 burst 40k
+tc class add dev plc0 parent 1:1 classid 1:4 htb rate 1Mbit ceil 5Mbit prio 2
+
+tc filter add dev plc0 protocol ip parent 1:0 handle 1 fw classid 1:2
+tc filter add dev plc0 protocol ip parent 1:0 handle 3 fw classid 1:3
+
+# matching destination and source mac addresses
+ebtables -A FORWARD -s 00:0f:fe:8c:2d:f5 -j mark --set-mark 1 --mark-target CONTINUE
+ebtables -A FORWARD -d 00:13:d7:20:03:98 -j ACCEPT
+ebtables -A FORWARD -d 00:90:47:00:00:11 -j mark --set-mark 3 --mark-target ACCEPT