Answer the question
In order to leave comments, you need to log in
Why does tc affect all connections?
Good afternoon. There is a desire to cut traffic on port 80. I use iptables + tc for this
iptables -A OUTPUT -t mangle -p tcp --sport 80 -j MARK --set-mark 10
iptables -A OUTPUT -t mangle -p tcp --sport 21 -j MARK --set-mark 6
iptables -A OUTPUT -t mangle -p tcp --sport 22 -j MARK --set-mark 7
tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 1:0 htb default 10
tc class add dev eth1 parent 1:0 classid 1:10 htb rate 7000kbps ceil 8000kbps prio 0
tc class add dev eth1 parent 1:0 classid 1:11 htb rate 80000kbps ceil 90000kbps prio 5
tc class add dev eth1 parent 1:0 classid 1:12 htb rate 80000kbps ceil 90000kbps prio 4
tc filter add dev eth1 parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
tc filter add dev eth1 parent 1:0 prio 0 protocol ip handle 6 fw flowid 1:11
tc filter add dev eth1 parent 1:0 prio 0 protocol ip handle 7 fw flowid 1:12
Answer the question
In order to leave comments, you need to log in
no need to mark OUTPUT
tc on ports, filters can be set by itself
tc filter add dev eth1 protocol ip parent 1:0 prio 25 u32 match \
ip sport 80 0xffff flowid 1:10
tc class add dev eth1 parent 1: classid 1:1 htb rate 100Mbit ceil 100Mbit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question