Score:0

How to set speed limit per IP in IP range in Ubuntu

jp flag

What I want:
I've setup a openvpn-server and want the clients in range of 10.8.0.0/21 limit their speed to 10mbit for each IP as a total limit of 100mbit.

wan interface     : eth0
openvpn interface : tun0
clients ip range  : 10.8.0.0/21

What I have done:
I've setup the tc filter with below config.

tc filter rules :

tc qdisc add dev eth0 root handle 1: htb default 10
tc class add dev eth0 parent 1: classid 1:10 htb rate 100mbit
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip dst 10.8.0.0/21 flowid 1:20
tc class add dev eth0 parent 1:20 classid 1:30 htb rate 10mbit
tc qdisc add dev eth0 parent 1:30 handle 30: sfq perturb 10

What is the problem:
When two client connect to server their speed will divide into two 5mbit (on usage).
it seems the total range of 10.8.0.0/21 get a speed limit of 10mbit and not a limit per IP.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.