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.For instance: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.UPDATEI 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 11tc class add dev eth0 parent 1: classid 1:1 htb rate 10mbittc class add dev eth0 parent 1: classid 1:2 htb rate 20mbittc filter add dev eth0 parent 1: protocol ip prio 16 u32 match ip dst 1.2.3.4 flowid 1:1tc filter add dev eth0 parent 1: protocol ip prio 16 u32 match ip dst 2.3.4.5 flowid 1:2
QoS with TC qdiscs: is it possible to have ALL outbound connections have x speed limit per unique IP?
linux;ubuntu;tc;qos
I don't know a QDISC that would do that directly. With CBQ/HTB/HFSC, at best you could create a limited number of 10mbps classes and then hash filter IPs into them. Apart from hash collisions which will obviously happen, it would work.With some luck, you can set such limits directly at the source (like, in the webserver).But if it's not really about rate limiting, but keeping things fair between clients, maybe you're better off with SFQ/ESFQ. While it does not limit, it does provide a kind of balance.