summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-09-26 14:44:32 +0200
committerGitHub <noreply@github.com>2020-09-26 14:44:32 +0200
commit9717d6630144a4c1acaa473d1bdacf2536f8e041 (patch)
tree571aa37d4f467a02bf0992b23b1914002f134cd5
parent374724be64728101c262fcac1579beece63ee651 (diff)
parentc2dcf10b28a19301a77d8043e6175b899765abf3 (diff)
downloadvyos-1x-9717d6630144a4c1acaa473d1bdacf2536f8e041.tar.gz
vyos-1x-9717d6630144a4c1acaa473d1bdacf2536f8e041.zip
Merge pull request #553 from sever-sever/T2917_port
accel-ppp: T2917: Add Preallocate NAS-port-id
-rw-r--r--data/templates/accel-ppp/pppoe.config.tmpl5
-rw-r--r--interface-definitions/include/accel-radius-additions.xml.i6
-rwxr-xr-xsrc/conf_mode/service_pppoe-server.py4
3 files changed, 15 insertions, 0 deletions
diff --git a/data/templates/accel-ppp/pppoe.config.tmpl b/data/templates/accel-ppp/pppoe.config.tmpl
index 5ad628fde..5003fcbb2 100644
--- a/data/templates/accel-ppp/pppoe.config.tmpl
+++ b/data/templates/accel-ppp/pppoe.config.tmpl
@@ -132,6 +132,11 @@ ccp=1
{% else %}
ccp=0
{% endif %}
+{% if ppp_preallocate_vif %}
+unit-preallocate=1
+{% else %}
+unit-preallocate=0
+{% endif %}
{% if ppp_min_mtu %}
min-mtu={{ ppp_min_mtu }}
{% else %}
diff --git a/interface-definitions/include/accel-radius-additions.xml.i b/interface-definitions/include/accel-radius-additions.xml.i
index e37b68514..42e7bec4a 100644
--- a/interface-definitions/include/accel-radius-additions.xml.i
+++ b/interface-definitions/include/accel-radius-additions.xml.i
@@ -85,6 +85,12 @@
</valueHelp>
</properties>
</leafNode>
+ <leafNode name="preallocate-vif">
+ <properties>
+ <help>Enable attribute NAS-Port-Id in Access-Request</help>
+ <valueless/>
+ </properties>
+ </leafNode>
<node name="dynamic-author">
<properties>
<help>Dynamic Authorization Extension/Change of Authorization server</help>
diff --git a/src/conf_mode/service_pppoe-server.py b/src/conf_mode/service_pppoe-server.py
index 45d3806d5..de15ca879 100755
--- a/src/conf_mode/service_pppoe-server.py
+++ b/src/conf_mode/service_pppoe-server.py
@@ -69,6 +69,7 @@ default_config_data = {
'ppp_min_mtu': '',
'ppp_mppe': 'prefer',
'ppp_mru': '',
+ 'ppp_preallocate_vif': False,
'radius_server': [],
'radius_acct_tmo': '3',
@@ -285,6 +286,9 @@ def get_config(config=None):
if conf.exists(['nas-ip-address']):
pppoe['radius_nas_ip'] = conf.return_value(['nas-ip-address'])
+ if conf.exists(['preallocate-vif']):
+ pppoe['ppp_preallocate_vif'] = True
+
if conf.exists(['source-address']):
pppoe['radius_source_address'] = conf.return_value(['source-address'])