summaryrefslogtreecommitdiff
path: root/polux/application/iproute2/examples/mark_outgoing2
diff options
context:
space:
mode:
Diffstat (limited to 'polux/application/iproute2/examples/mark_outgoing2')
-rw-r--r--polux/application/iproute2/examples/mark_outgoing222
1 files changed, 22 insertions, 0 deletions
diff --git a/polux/application/iproute2/examples/mark_outgoing2 b/polux/application/iproute2/examples/mark_outgoing2
new file mode 100644
index 0000000000..057cd758d2
--- /dev/null
+++ b/polux/application/iproute2/examples/mark_outgoing2
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Prioritize outgoing traffic from PLC modem with IP address 192.168.100.33
+# by marking packets with iptables and filtering with tc putting in PRIO qdisc
+
+# PRIO with 3 queues, first priority uses SFQ qdisc for fair scheduling
+# second limit with simple TBF rating traffic to 100kbit
+# third (lowest) priority uses SFQ
+
+tc qdisc del dev plc0 root handle 1:
+
+tc qdisc add dev plc0 root handle 1: prio
+tc qdisc add dev plc0 parent 1:1 handle 10: sfq
+tc qdisc add dev plc0 parent 1:2 handle 20: tbf rate 100kbit buffer 1600 limit 3000
+tc qdisc add dev plc0 parent 1:3 handle 30: sfq
+
+# put marked traffic to flow 1:1 (most priority)
+tc filter add dev plc0 protocol ip parent 1:0 prio 1 handle 3 fw flowid 1:1
+
+# mark outgoing packets
+iptables -A OUTPUT -t mangle -s 192.168.100.33 -j MARK --set-mark 3
+