Skip to content

Commit

Permalink
T5704: PPPoE L2TP SSTP IPoE add option max-concurrent-sessions
Browse files Browse the repository at this point in the history
Add `max-starting` option:

  [common]
  max-starting=N

Specifies maximum concurrent session attempts which server may processed

  set service pppoe-server max-concurrent-sessions '30'

Useful to prevent high CPU utilization and compat execution
scripts per time.
  • Loading branch information
sever-sever committed Nov 2, 2023
1 parent 4f05f70 commit 47645f9
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 1 deletion.
5 changes: 5 additions & 0 deletions data/templates/accel-ppp/ipoe.config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ ippool
[core]
thread-count={{ thread_count }}

[common]
{% if max_concurrent_sessions is vyos_defined %}
max-starting={{ max_concurrent_sessions }}
{% endif %}

[log]
syslog=accel-ipoe,daemon
copy=1
Expand Down
5 changes: 5 additions & 0 deletions data/templates/accel-ppp/l2tp.config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ ipv6_dhcp
[core]
thread-count={{ thread_cnt }}

[common]
{% if max_concurrent_sessions is vyos_defined %}
max-starting={{ max_concurrent_sessions }}
{% endif %}

[log]
syslog=accel-l2tp,daemon
copy=1
Expand Down
5 changes: 4 additions & 1 deletion data/templates/accel-ppp/pppoe.config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ wins{{ loop.index }}={{ server }}
{# Common chap-secrets and RADIUS server/option definitions #}
{% include 'accel-ppp/config_chap_secrets_radius.j2' %}

{% if session_control is vyos_defined and session_control is not vyos_defined('disable') %}
[common]
{% if session_control is vyos_defined and session_control is not vyos_defined('disable') %}
single-session={{ session_control }}
{% endif %}
{% if max_concurrent_sessions is vyos_defined %}
max-starting={{ max_concurrent_sessions }}
{% endif %}

[ppp]
verbose=1
Expand Down
5 changes: 5 additions & 0 deletions data/templates/accel-ppp/pptp.config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ ippool
[core]
thread-count={{ thread_cnt }}

[common]
{% if max_concurrent_sessions is vyos_defined %}
max-starting={{ max_concurrent_sessions }}
{% endif %}

[log]
syslog=accel-pptp,daemon
copy=1
Expand Down
3 changes: 3 additions & 0 deletions data/templates/accel-ppp/sstp.config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ thread-count={{ thread_count }}

[common]
single-session=replace
{% if max_concurrent_sessions is vyos_defined %}
max-starting={{ max_concurrent_sessions }}
{% endif %}

[log]
syslog=accel-sstp,daemon
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- include start from accel-ppp/max-concurrent-sessions.xml.i -->
<leafNode name="max-concurrent-sessions">
<properties>
<help>Maximum number of concurrent session start attempts</help>
<valueHelp>
<format>u32:0-65535</format>
<description>Maximum number of concurrent session start attempts</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--allow-range --range 0-65535"/>
</constraint>
<constraintErrorMessage>Maximum concurent sessions must be in range 0-65535</constraintErrorMessage>
</properties>
</leafNode>
<!-- include end -->
1 change: 1 addition & 0 deletions interface-definitions/service-ipoe-server.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
#include <include/accel-ppp/vlan.xml.i>
</children>
</tagNode>
#include <include/accel-ppp/max-concurrent-sessions.xml.i>
#include <include/name-server-ipv4-ipv6.xml.i>
<node name="client-ip-pool">
<properties>
Expand Down
1 change: 1 addition & 0 deletions interface-definitions/service-pppoe-server.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
</children>
</tagNode>
#include <include/accel-ppp/gateway-address.xml.i>
#include <include/accel-ppp/max-concurrent-sessions.xml.i>
#include <include/accel-ppp/mtu-128-16384.xml.i>
<node name="limits">
<properties>
Expand Down
1 change: 1 addition & 0 deletions interface-definitions/vpn-l2tp.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<help>Remote access L2TP VPN</help>
</properties>
<children>
#include <include/accel-ppp/max-concurrent-sessions.xml.i>
#include <include/accel-ppp/mtu-128-16384.xml.i>
<leafNode name="outside-address">
<properties>
Expand Down
1 change: 1 addition & 0 deletions interface-definitions/vpn-pptp.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<help>Remote access PPTP VPN</help>
</properties>
<children>
#include <include/accel-ppp/max-concurrent-sessions.xml.i>
#include <include/accel-ppp/mtu-128-16384.xml.i>
<leafNode name="outside-address">
<properties>
Expand Down
1 change: 1 addition & 0 deletions interface-definitions/vpn-sstp.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
</node>
</children>
</node>
#include <include/accel-ppp/max-concurrent-sessions.xml.i>
#include <include/interface/mtu-68-1500.xml.i>
#include <include/accel-ppp/gateway-address.xml.i>
#include <include/name-server-ipv4-ipv6.xml.i>
Expand Down

0 comments on commit 47645f9

Please sign in to comment.