Bandwidth Limit Option?
-
- Posts: 26
- Joined: Tue May 28, 2013 12:00 am
Bandwidth Limit Option?
Hello,
I've cruised through the options and have not found one to set a limit, such as allocating 50GB on a plan. A user gets 50GB and if limit is reach the session is disconnected.
Is there such an option or any insight on a possible solution would be appreciated.
Thank you,
I've cruised through the options and have not found one to set a limit, such as allocating 50GB on a plan. A user gets 50GB and if limit is reach the session is disconnected.
Is there such an option or any insight on a possible solution would be appreciated.
Thank you,
-
- Site Admin
- Posts: 2274
- Joined: Sat Mar 09, 2013 5:37 am
Re: Bandwidth Limit Option?
Traffic bandwidth limit option is in security policy setting of a user or a group.
-
- Posts: 26
- Joined: Tue May 28, 2013 12:00 am
Re: Bandwidth Limit Option?
Yes there is a limit for the speed(bps)- however not seeing one for the amount of traffic, such as a client downloading 50GB on a plan over a month per say.
-
- Site Admin
- Posts: 2274
- Joined: Sat Mar 09, 2013 5:37 am
Re: Bandwidth Limit Option?
There is no traffic amount limitation function in VPN server.
But traffic amount per user is visible in user profile.
You can make a batch to disable user account when traffic amount exceeds limit.
But traffic amount per user is visible in user profile.
You can make a batch to disable user account when traffic amount exceeds limit.
-
- Posts: 18
- Joined: Sun Oct 20, 2013 6:58 am
Re: Bandwidth Limit Option?
cedar wrote:
> There is no traffic amount limitation function in VPN server.
> But traffic amount per user is visible in user profile.
> You can make a batch to disable user account when traffic amount exceeds
> limit.
but how to create a batch?
same problem here. i need to set example 25gb quota limit each user. but no option. just speed limit option...
> There is no traffic amount limitation function in VPN server.
> But traffic amount per user is visible in user profile.
> You can make a batch to disable user account when traffic amount exceeds
> limit.
but how to create a batch?
same problem here. i need to set example 25gb quota limit each user. but no option. just speed limit option...
-
- Posts: 370
- Joined: Fri Oct 18, 2013 8:15 am
Re: Bandwidth Limit Option?
Ardy7201 wrote:
> but how to create a batch?
> same problem here. i need to set example 25gb quota limit each user. but no option.
> just speed limit option...
You may use the vpncmd shell.
> but how to create a batch?
> same problem here. i need to set example 25gb quota limit each user. but no option.
> just speed limit option...
You may use the vpncmd shell.
Last edited by inten on Mon Oct 21, 2013 1:40 am, edited 2 times in total.
-
- Posts: 18
- Joined: Sun Oct 20, 2013 6:58 am
Re: Bandwidth Limit Option?
inten wrote:
> Ardy7201 wrote:
>
> > but how to create a batch?
> > same problem here. i need to set example 25gb quota limit each user. but no
> option.
> > just speed limit option...
>
> You may use the vpncmd shell.
but how? sorry newbie here
> Ardy7201 wrote:
>
> > but how to create a batch?
> > same problem here. i need to set example 25gb quota limit each user. but no
> option.
> > just speed limit option...
>
> You may use the vpncmd shell.
but how? sorry newbie here
-
- Posts: 17
- Joined: Fri Oct 18, 2013 8:39 am
Re: Bandwidth Limit Option?
that's a good idea for the next feature :)
by the way.. i need it too,
some one please give us some clue using vpncmd
by the way.. i need it too,
some one please give us some clue using vpncmd
-
- Posts: 370
- Joined: Fri Oct 18, 2013 8:15 am
Re: Bandwidth Limit Option?
elborneo wrote:
> that's a good idea for the next feature :)
> by the way.. i need it too,
> some one please give us some clue using vpncmd
We are currently cooking such script, please wait, will publish it here.
> that's a good idea for the next feature :)
> by the way.. i need it too,
> some one please give us some clue using vpncmd
We are currently cooking such script, please wait, will publish it here.
-
- Posts: 18
- Joined: Sun Oct 20, 2013 6:58 am
Re: Bandwidth Limit Option?
inten wrote:
> elborneo wrote:
> > that's a good idea for the next feature :)
> > by the way.. i need it too,
> > some one please give us some clue using vpncmd
>
> We are currently cooking such script, please wait, will publish it here.
thank you very much! im waiting the script...
im still new on hot to manage client, client info, server in batch
> elborneo wrote:
> > that's a good idea for the next feature :)
> > by the way.. i need it too,
> > some one please give us some clue using vpncmd
>
> We are currently cooking such script, please wait, will publish it here.
thank you very much! im waiting the script...
im still new on hot to manage client, client info, server in batch
-
- Posts: 370
- Joined: Fri Oct 18, 2013 8:15 am
Re: Bandwidth Limit Option?
Ardy7201 wrote:
> thank you very much! im waiting the script...
Please be patient! This script is a part small part of our VPN Hosting Management solution and it needs to be adopted to run solely.
> thank you very much! im waiting the script...
Please be patient! This script is a part small part of our VPN Hosting Management solution and it needs to be adopted to run solely.
-
- Posts: 17
- Joined: Fri Oct 18, 2013 8:39 am
Re: Bandwidth Limit Option?
inten wrote:
> Ardy7201 wrote:
>
> > thank you very much! im waiting the script...
>
> Please be patient! This script is a part small part of our VPN Hosting Management
> solution and it needs to be adopted to run solely.
thanks inten..
i hope you can also provide us some option to set the connection timeout manualy to vpn client, that would be great to solve my problem here http://www.vpnusers.com/viewtopic.php?f=7&t=2330
> Ardy7201 wrote:
>
> > thank you very much! im waiting the script...
>
> Please be patient! This script is a part small part of our VPN Hosting Management
> solution and it needs to be adopted to run solely.
thanks inten..
i hope you can also provide us some option to set the connection timeout manualy to vpn client, that would be great to solve my problem here http://www.vpnusers.com/viewtopic.php?f=7&t=2330
-
- Posts: 370
- Joined: Fri Oct 18, 2013 8:15 am
Re: Bandwidth Limit Option?
Here we go.
This powershell script moves the users with exceeding amount of $Limit(bytes) to Disabled_Users group, where you can assign any policy you need to block. Please take a closer look at the params in the vpncmd string, you need to change them accordingly. Also please note this script counts incoming traffic only and if you need overall traffic you also need to change it in the script.
Do not hesitate if you need smth.
$Limit = 10737418240 // in bytes
$Password = "print pass here"
$result = Invoke-Expression -command "vpncmd /server localhost /hub:DEFAULT /password:$Password /cmd:UserList"
$regex = new-object System.Text.RegularExpressions.Regex("User Name\s*\|\s*(.*?)\s")
foreach($match in $regex.Matches($result))
{
$username = $match.Groups[1].Value
$result = Invoke-Expression -command "vpncmd /server localhost /hub:DEFAULT /password:$Password /cmd:UserGet $username"
$regexUnicast = new-object System.Text.RegularExpressions.Regex("Outgoing Unicast Total Size\s*\|\s*([,\d]+)\s+bytes")
$regexBroadcast = new-object System.Text.RegularExpressions.Regex("Outgoing Broadcast Total Size\s*\|\s*([,\d]+)\s+bytes")
$totalOutgoing = [int]$regexUnicast.Match($result).Groups[1].Value.Replace(",", "") + [int]$regexBroadcast.Match($result).Groups[1].Value.Replace(",", "")
$regexUnicast = new-object System.Text.RegularExpressions.Regex("Incoming Unicast Total Size\s*\|\s*([,\d]+)\s+bytes")
$regexBroadcast = new-object System.Text.RegularExpressions.Regex("Incoming Broadcast Total Size\s*\|\s*([,\d]+)\s+bytes")
$totalIncoming = [int]$regexUnicast.Match($result).Groups[1].Value.Replace(",", "") + [int]$regexBroadcast.Match($result).Groups[1].Value.Replace(",", "")
Write-Host ("User " + $username)
Write-Host ("Total incoming: " + $totalIncoming + " bytes")
Write-Host ("Total outgoing: " + $totalOutgoing + " bytes")
if ($totalIncoming -ge $Limit)
{
Invoke-Expression -command "vpncmd /server localhost /hub:DEFAULT /password:$Password /cmd:GroupJoin 'Disabled_Users' /username:$username"
Write-Host "User Moved"
}
Write-Host
}
This powershell script moves the users with exceeding amount of $Limit(bytes) to Disabled_Users group, where you can assign any policy you need to block. Please take a closer look at the params in the vpncmd string, you need to change them accordingly. Also please note this script counts incoming traffic only and if you need overall traffic you also need to change it in the script.
Do not hesitate if you need smth.
$Limit = 10737418240 // in bytes
$Password = "print pass here"
$result = Invoke-Expression -command "vpncmd /server localhost /hub:DEFAULT /password:$Password /cmd:UserList"
$regex = new-object System.Text.RegularExpressions.Regex("User Name\s*\|\s*(.*?)\s")
foreach($match in $regex.Matches($result))
{
$username = $match.Groups[1].Value
$result = Invoke-Expression -command "vpncmd /server localhost /hub:DEFAULT /password:$Password /cmd:UserGet $username"
$regexUnicast = new-object System.Text.RegularExpressions.Regex("Outgoing Unicast Total Size\s*\|\s*([,\d]+)\s+bytes")
$regexBroadcast = new-object System.Text.RegularExpressions.Regex("Outgoing Broadcast Total Size\s*\|\s*([,\d]+)\s+bytes")
$totalOutgoing = [int]$regexUnicast.Match($result).Groups[1].Value.Replace(",", "") + [int]$regexBroadcast.Match($result).Groups[1].Value.Replace(",", "")
$regexUnicast = new-object System.Text.RegularExpressions.Regex("Incoming Unicast Total Size\s*\|\s*([,\d]+)\s+bytes")
$regexBroadcast = new-object System.Text.RegularExpressions.Regex("Incoming Broadcast Total Size\s*\|\s*([,\d]+)\s+bytes")
$totalIncoming = [int]$regexUnicast.Match($result).Groups[1].Value.Replace(",", "") + [int]$regexBroadcast.Match($result).Groups[1].Value.Replace(",", "")
Write-Host ("User " + $username)
Write-Host ("Total incoming: " + $totalIncoming + " bytes")
Write-Host ("Total outgoing: " + $totalOutgoing + " bytes")
if ($totalIncoming -ge $Limit)
{
Invoke-Expression -command "vpncmd /server localhost /hub:DEFAULT /password:$Password /cmd:GroupJoin 'Disabled_Users' /username:$username"
Write-Host "User Moved"
}
Write-Host
}
Last edited by inten on Mon Oct 21, 2013 12:48 pm, edited 1 time in total.
-
- Posts: 17
- Joined: Fri Oct 18, 2013 8:39 am
Re: Bandwidth Limit Option?
inten wrote:
> Here we go.
> The script moves the users with exceeding amount of $Limit(bytes) to
> Disabled_Users group, where you can assign any policy you need to block.
> Please take a closer look at the params in the vpncmd string, you need to
> change them accordingly. Also please note this script counts incoming
> traffic only and if you need overall traffic you also need to change it in
> the script.
> Do not hesitate if you need smth.
how to load this script?
sorry.. newbie question :)
> Here we go.
> The script moves the users with exceeding amount of $Limit(bytes) to
> Disabled_Users group, where you can assign any policy you need to block.
> Please take a closer look at the params in the vpncmd string, you need to
> change them accordingly. Also please note this script counts incoming
> traffic only and if you need overall traffic you also need to change it in
> the script.
> Do not hesitate if you need smth.
how to load this script?
sorry.. newbie question :)
-
- Posts: 370
- Joined: Fri Oct 18, 2013 8:15 am
Re: Bandwidth Limit Option?
elborneo wrote:
> how to load this script?
powershell, ёпта.
> how to load this script?
powershell, ёпта.
-
- Posts: 18
- Joined: Sun Oct 20, 2013 6:58 am
Re: Bandwidth Limit Option?
inten wrote:
> elborneo wrote:
> > how to load this script?
>
> powershell, ёпта.
even how to you use powershell? please make some tutorial. step by step. easy mode. newbie here. how to apply the script. incoming traffic only? how to change to total overall traffic by user?
> elborneo wrote:
> > how to load this script?
>
> powershell, ёпта.
even how to you use powershell? please make some tutorial. step by step. easy mode. newbie here. how to apply the script. incoming traffic only? how to change to total overall traffic by user?
-
- Posts: 370
- Joined: Fri Oct 18, 2013 8:15 am
Re: Bandwidth Limit Option?
Ardy7201 wrote:
> even how to you use powershell? please make some tutorial. step by step. easy mode.
> newbie here. how to apply the script. incoming traffic only? how to change to total
> overall traffic by user?
What is yr OS?
> even how to you use powershell? please make some tutorial. step by step. easy mode.
> newbie here. how to apply the script. incoming traffic only? how to change to total
> overall traffic by user?
What is yr OS?
-
- Posts: 18
- Joined: Sun Oct 20, 2013 6:58 am
Re: Bandwidth Limit Option?
inten wrote:
> Ardy7201 wrote:
>
> > even how to you use powershell? please make some tutorial. step by step. easy mode.
> > newbie here. how to apply the script. incoming traffic only? how to change to total
> > overall traffic by user?
>
> What is yr OS?
WIn 7 64 bit. thanks bro
> Ardy7201 wrote:
>
> > even how to you use powershell? please make some tutorial. step by step. easy mode.
> > newbie here. how to apply the script. incoming traffic only? how to change to total
> > overall traffic by user?
>
> What is yr OS?
WIn 7 64 bit. thanks bro
-
- Posts: 370
- Joined: Fri Oct 18, 2013 8:15 am
Re: Bandwidth Limit Option?
Don't get me wrong but I don't know how to explain you the way to run PowerShell (powershell.exe). Just save the script into a file, save it with .ps1 extension and then run it from powershell, don't forget to edit to run on your system.
Please understand that currently I have no enough free time to write a whole tutorial for small script. It would be better you could ask here if you need something, I will try to help.
Please understand that currently I have no enough free time to write a whole tutorial for small script. It would be better you could ask here if you need something, I will try to help.
-
- Posts: 18
- Joined: Sun Oct 20, 2013 6:58 am
Re: Bandwidth Limit Option?
inten wrote:
> Don't get me wrong but I don't know how to explain you the way to run
> PowerShell (powershell.exe). Just save the script into a file, save it with
> .ps1 extension and then run it from powershell, don't forget to edit to run
> on your system.
> Please understand that currently I have no enough free time to write a
> whole tutorial for small script. It would be better you could ask here if
> you need something, I will try to help.
ok.
Windows 7 64bit
step 1 : http://prntscr.com/207h1s
step 2 (just paste the script to powershell?) : http://prntscr.com/207h9q
step 3 (save the script in notepad a.ps1 and load with powershell) : http://prntscr.com/207hn3
ste* 4 : http://prntscr.com/207hva
step 5 (error execute script on system) : http://prntscr.com/207i31
step 6 (enable the script execution on win 7) :
Try the following steps and check if it helps:
a) Right-click your PowerShell icon and select Run as administrator.
b) Check the current script execution policy by using the Get-ExecutionPolicy cmdlet. To do this, input “Get-ExecutionPolicy” (without quotes) and press Enter on your keyboard. PowerShell will return a value of Restricted.
c) To change the script execution policy, use the Set-ExecutionPolicy cmdlet. Input “Set-ExecutionPolicy unrestricted” (without quotes) and press Enter on your keyboard.
d) To ensure that the script execution policy has been changed, use the Get-ExecutionPolicy cmdlet again. PowerShell should return a value of Unrestricted.
e) You should now be able to run your PowerShell scripts.
still dont work
> Don't get me wrong but I don't know how to explain you the way to run
> PowerShell (powershell.exe). Just save the script into a file, save it with
> .ps1 extension and then run it from powershell, don't forget to edit to run
> on your system.
> Please understand that currently I have no enough free time to write a
> whole tutorial for small script. It would be better you could ask here if
> you need something, I will try to help.
ok.
Windows 7 64bit
step 1 : http://prntscr.com/207h1s
step 2 (just paste the script to powershell?) : http://prntscr.com/207h9q
step 3 (save the script in notepad a.ps1 and load with powershell) : http://prntscr.com/207hn3
ste* 4 : http://prntscr.com/207hva
step 5 (error execute script on system) : http://prntscr.com/207i31
step 6 (enable the script execution on win 7) :
Try the following steps and check if it helps:
a) Right-click your PowerShell icon and select Run as administrator.
b) Check the current script execution policy by using the Get-ExecutionPolicy cmdlet. To do this, input “Get-ExecutionPolicy” (without quotes) and press Enter on your keyboard. PowerShell will return a value of Restricted.
c) To change the script execution policy, use the Set-ExecutionPolicy cmdlet. Input “Set-ExecutionPolicy unrestricted” (without quotes) and press Enter on your keyboard.
d) To ensure that the script execution policy has been changed, use the Get-ExecutionPolicy cmdlet again. PowerShell should return a value of Unrestricted.
e) You should now be able to run your PowerShell scripts.
still dont work
-
- Posts: 370
- Joined: Fri Oct 18, 2013 8:15 am
Re: Bandwidth Limit Option?
skype me: ksimonenko (you this symbol here) outlook.com
Last edited by inten on Mon Oct 28, 2013 12:14 pm, edited 1 time in total.
-
- Posts: 18
- Joined: Sun Oct 20, 2013 6:58 am
Re: Bandwidth Limit Option?
ok. now i got it. thanks for your help in skype
now, to set limit for user "admin"
how to set in script?
now, to set limit for user "admin"
how to set in script?
-
- Posts: 370
- Joined: Fri Oct 18, 2013 8:15 am
Re: Bandwidth Limit Option?
Ardy7201 wrote:
> ok. now i got it. thanks for your help in skype
>
> now, to set limit for user "admin"
>
> how to set in script?
this script cannot set limits for different users, you can apply user a group that has some limitations even to disconnect.
> ok. now i got it. thanks for your help in skype
>
> now, to set limit for user "admin"
>
> how to set in script?
this script cannot set limits for different users, you can apply user a group that has some limitations even to disconnect.
-
- Posts: 4
- Joined: Fri Jul 14, 2017 5:48 am
Re: Bandwidth Limit Option?
Hey guys, does anyone have this script for Linux (Ubuntu)? Would be very helpful, thank you!
-
- Posts: 3
- Joined: Sun Aug 13, 2017 11:38 am
Re: Bandwidth Limit Option?
Is there a linux version of this? I'd really like to get this working.
-
- Posts: 289
- Joined: Wed Dec 28, 2022 9:10 pm
Re: Bandwidth Limit Option?
From now it is possible
You can use secli
https://github.com/shakibamoshiri/secli
it gives you a report for a user traffic
- have
- used
- rest
and when "rest" became negative, it means that user has exceeded the limitation.
So simply disable the user
secli user --disable <SERVER> <HUB> <USERNAME>
You can use secli
https://github.com/shakibamoshiri/secli
it gives you a report for a user traffic
- have
- used
- rest
and when "rest" became negative, it means that user has exceeded the limitation.
So simply disable the user
secli user --disable <SERVER> <HUB> <USERNAME>