Linux Router - Share bandwidth per IPs with current active connections

Posted by SRoe on Server Fault See other posts from Server Fault or by SRoe
Published on 2012-07-03T07:54:11Z Indexed on 2012/07/03 9:17 UTC
Read the original article Hit count: 393

Filed under:
|
|

We have a Linux machine running as a custom router, currently utilising Shorewall. This sits between our incoming internet connection and the internal LAN.

What we would like to achieve is 'fair use' of the bandwidth on a per IP basis. If only one person currently has an active connection then they get 100% utilisation of the line. However if 20 people have active connections then they should each get 5% utilisation of the line.

This should be irrespective of the number of connections held by each user. For example, say we have two users, Bill and Ted, that both have active connections. Bill has a single active connection while Ted has ten active connections. Bill should get 50% utilisation for his single connections whilst Ted should get 5% utilisation for each of his ten connections, giving Ted a total utilisation of 50%.

© Server Fault or respective owner

Related posts about linux

Related posts about bandwidth