Answer the question
In order to leave comments, you need to log in
How to limit speed for IPIP tunnel?
Good day!
Whether probably by means of iptables to limit the entering and proceeding speed on IPIP/GRE tunnels?
Here is an example of what I tried to do, but without results.
iptables -t mangle -N SHAPER-OUT
iptables -t mangle -I POSTROUTING -o eth0 -j SHAPER-OUT
iptables -t mangle -I POSTROUTING -o eth1 -j SHAPER-OUT
tc qdisc del dev ipip3 root
tc qdisc add dev ipip3 root handle 1:0 htb default 10
tc class add dev ipip3 parent 1:0 classid 1:1 htb rate 100Mbit burst 131072
tc class add dev ipip3 parent 1:1 classid 1:10 htb rate 100Mbit burst 131072
tc qdisc add dev ipip3 parent 1:10 sfq perturb 10
tc qdisc del dev ipip4 root
tc qdisc add dev ipip4 root handle 1:0 htb default 10
tc class add dev ipip4 parent 1:0 classid 1:1 htb rate 100Mbit burst 131072
tc class add dev ipip4 parent 1:1 classid 1:10 htb rate 100Mbit burst 131072
tc qdisc add dev ipip4 parent 1:10 sfq perturb 10
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1:0 htb default 10
tc class add dev eth0 parent 1:0 classid 1:1 htb rate 1000Mbit burst 1310720
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 1000Mbit burst 1310720
tc qdisc add dev eth0 parent 1:10 sfq perturb 10
# One of the users
iptables -t mangle -A SHAPER-OUT -s 10.10.16.1 -j MARK - -set-mark 0x1003
iptables -t mangle -A SHAPER-OUT -s 10.10.17.1 -j MARK --set-mark 0x1004
tc class add dev ipip4 parent 1:1 classid 1:1003 htb rate 100Mbit burst 25600
tc class add dev ipip3 parent 1:1 classid 1:1003 htb rate 100Mbit burst 25600
tc class add dev eth0 parent 1:1 classid 1:1003 htb rate 100Mbit burst 25600
tc class add dev ipip4 parent 1:1 classid 1:1003 htb rate 100Mbit burst 25600
tc class add dev ipip3 parent 1:1 classid 1:1003 htb rate 100Mbit burst 25600
tc class add dev eth0 parent 1:1 classid 1:1003 htb rate 1000Mbit burst 25600
tc filter add dev ipip3 parent 1:0 protocol ip u32 match ip dst 10.10.16.1 classid 1:1003
tc filter add dev ipip4 parent 1:0 protocol ip u32 match ip dst 10.10.17.1 classid 1:1003
tc filter add dev ipip3 parent 1:0 protocol ip handle 0x1003 fw classid 1:1003
tc filter add dev ipip4 parent 1:0 protocol ip handle 0x1003 fw classid 1:
1003 classid 1:1003
In short:
eth0 is the external interface of
ipip3 and ipip4 is the IPIP tunnel to the client, you need to limit the speed per tunnel to 100Mbps.
Is it even possible?
Answer the question
In order to leave comments, you need to log in
tc command like
https://askubuntu.com/questions/776/how-i-can-limi...
Or wondershaper
https://unix.stackexchange.com/questions/28198/how...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question