TransWikia.com

rate limiting traffic for internal ip (TC)

Server Fault Asked by JohnsonGoey on December 13, 2021

I have configured ikev2 VPN on my server, but there is no tunnel interfaces like openvpn (tun0).

So actually, I can’t limit the ikev2 vpn speed using tc tool.

Example for traffic shapping of openvpn (tun0) below.

tc qdisc del dev tun0 root
tc qdisc add dev tun0 root handle 1: htb
tc class add dev tun0 parent 1:1 classid 1:10 htb rate 1mbit ceil 1mbit
tc class add dev tun0 parent 1:1 classid 1:20 htb rate 1mbit ceil 1mbit
tc qdisc add dev tun0 parent 1:10 sfq perturb 10
tc qdisc add dev tun0 parent 1:20 sfq perturb 10
tc filter add dev tun0 protocol ip parent 1: prio 50 u32 match ip src 10.24.26.1/32  flowid 1:10

Because ikev2 doesn’t have a tunnel interface I can’t limit the internal IP speed using even tc.

Any idea on it?

I need to limit individual internal ip speed 10.24.26.1-10.24.26.255.

One Answer

ok guys, i already found out the way by limiting using internal address of ikev2

iptables -I FORWARD -s 10.24.26.2 -j MARK --set-mark 6
iptables -I FORWARD -d 10.24.26.2 -j MARK --set-mark 6
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 1mbit ceil 1mbit
tc qdisc add dev eth0 parent 1:10 sfq perturb 10
tc filter add dev eth0 protocol ip parent 1: prio 1 handle 6 fw flowid 1:10

Answered by JohnsonGoey on December 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP