Freeradius + OpenVPN Solution to Traffic Limitation
I need to limit the monthly traffic of OpenVPN users on my server. Example: After a 50G/month traffic limitation has been reached, the server will disconnect and reject connections from that user for that period of time. Everything seems to point out to Freeradius as the best solution! I'm just having problems finding any guidance to achieving this.. could someone please instruct? Thank you, Chiappa
ToriTori wrote:
I need to limit the monthly traffic of OpenVPN users on my server. Example: After a 50G/month traffic limitation has been reached, the server will disconnect and reject connections from that user for that period of time.
Everything seems to point out to Freeradius as the best solution! I'm just having problems finding any guidance to achieving this.. could someone please instruct?
Well, FreeRADIUS does RADIUS. OpenVPN does VPN, including traffic limits. You may be able to use RADIUS to tell OpenVPN to limit traffic. But this requires: a) configuring OpenVPN to do RADIUS authentication b) configuring FreeRADIUS to authenticate the OpenVPN users c) configuring FreeRADIUS to send back the attributes needed by OpenVPN For the last step, you'll need to consult the OpenVPN documentation for which attributes are required / supported. Alan DeKok.
On Thu, Nov 1, 2012 at 9:23 PM, ToriTori <contact@toritori.fi> wrote:
I need to limit the monthly traffic of OpenVPN users on my server. Example: After a 50G/month traffic limitation has been reached, the server will disconnect
I don't think openvpn has support for that.
and reject connections from that user for that period of time.
Should be possible. Assuming you know enough to integrate openvpn with radius.
Everything seems to point out to Freeradius as the best solution! I'm just having problems finding any guidance to achieving this.. could someone please instruct?
On FR's side there this: http://wiki.freeradius.org/modules/Rlm_sqlcounter That's the easy part. The "openvpn and radius integration" part is the hard one, and I'm afraid you need to look elsewhere. Try openvpn list, or hire someone with experience implementing this. -- Fajar
A naive way would be, use OpenVPN's radiusplugin to authenticate user with a radius server. On the server side, use MySQL as data backend. Then you'll be able to run a crontab at a reasonable frequency to disable users who have used the quota already and reject new connection. If you need to kick users offline when that user used all quotas and still connecting, you may need to look into OpenVPN's management console. -- http://about.me/yegle On Thursday, November 1, 2012 at 10:23, ToriTori wrote:
I need to limit the monthly traffic of OpenVPN users on my server. Example: After a 50G/month traffic limitation has been reached, the server will disconnect and reject connections from that user for that period of time.
Everything seems to point out to Freeradius as the best solution! I'm just having problems finding any guidance to achieving this.. could someone please instruct?
Thank you, Chiappa - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Thu, Nov 1, 2012 at 9:39 PM, yegle <cnyegle@gmail.com> wrote:
A naive way would be, use OpenVPN's radiusplugin to authenticate user with a radius server.
Correct. That's the first part of openvpn-radius integration. Which works, and still somewhat easy enough.
Then you'll be able to run a crontab at a reasonable frequency to disable users who have used the quota already and reject new connection.
No need for that. That's what sqlcounter is for.
If you need to kick users offline when that user used all quotas and still connecting, you may need to look into OpenVPN's management console.
This is probably the hardest part of the integration. -- Fajar
participants (4)
-
Alan DeKok -
Fajar A. Nugraha -
ToriTori -
yegle