I'm trying to setup QoS in my VPS so that I can have any new outbound connection to a unique IP gets limited x speed.
- have 5 public IP's requesting data from my VPS.
- When the VPS sends data back to each of those IP's, each IP gets 10mbps dedicated outbound bandwidth speed.
- Never drop packets, rather queue them if client surpasses 10mbps.
I don't want to limit the whole eth0 port to 10mbps outbound speed, I want each individual public IP to get 10mbps.
I have frequently different public IP's contacting my VPS so I would rather not have to write rules that are static which force me to write individually each bandwidth rule per IP.
Is this possible with TC qdiscs?
I've looked over what appears to be the typical setup of HTB qdics which allow me to have filters etc. But could not seem to see an example or literature that describes what I want.
I'm using ubuntu server 14.04.
I did the following once I understood the way TC qdiscs work a bit better.
commands I used for a basic setup which appears to work quite smoothly as packets aren't dropping but rather going into the token bucket(note: this is not highly optimized but appears to run stock pretty well):
tc qdisc add dev eth0 root handle 1: htb default 11 tc class add dev eth0 parent 1: classid 1:1 htb rate 10mbit tc class add dev eth0 parent 1: classid 1:2 htb rate 20mbit tc filter add dev eth0 parent 1: protocol ip prio 16 u32 match ip dst 188.8.131.52 flowid 1:1 tc filter add dev eth0 parent 1: protocol ip prio 16 u32 match ip dst 184.108.40.206 flowid 1:2