Debian – How to setup a traffic limit per user on OpenVPN

debianlimitsnetwork-trafficopenvpntraffic-management

I am setting up a VPN server using OpenVPN. The authentication method is the certificate one (different certs for client and server). The VPS has 1TB of traffic monthly.

I plan allowing up to 4 clients per one server. So I'd like to restrict the client using more than 250GB per month.

I thought I might have restricted the amount of traffic coming from one IP, but this idea wouldn't solve the problem – clients may login from either their phone, PC, or tablet.

Ideally, I expect a statement in the .ovpn client file which would be able to control the amount of traffic coming from one client. I haven't found it, though.

How to setup the restriction? Thanks.

Best Answer

I'm a bit late to the party, but you can use the client-config-dir option to assign each client conf a local IP address. Then you can use Linux's Traffic Control (tc) to limit the bandwidth for each IP (and thus for each client). Would that work for you ?

Related Topic