I configured the IPsec VPN server using Libreswan on CentOS 7 and Ubuntu 18.04 at the same time. Now I want to limit the internet speed on each connection. I searched the internet and found Linux Traffic Control (
IPTABLES can do that. But the two seem very complex to understand.
What have I tried so far?
I have tried many commands from
IPTABLES. I share some of them more clearly for myself.
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root tbf rate 50kbit burst 32kbit latency 400ms
I have tried to limit the speed of 50KB per second for all IP addresses separately, but this limits all of the Internet from the server.
sudo iptables --new-chain RATE-LIMIT
sudo iptables --append RATE-LIMIT --match hashlimit --hashlimit-mode srcip --hashlimit-upto 50/sec --hashlimit-burst 20 --hashlimit-name conn_rate_limit --jump ACCEPT
Here I have tried to create a new group
RATE-LIMIT to limit 50 KB per second to each client, but that doesn't work for me
I am new
IPTABLES and did not understand it well. Can you help me please?