summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-09-28 19:30:46 +0200
committerGitHub <noreply@github.com>2020-09-28 19:30:46 +0200
commit278d3e62f56f5f7b3c25bbe0cab953c64fbe1fc6 (patch)
tree3f3bd339cbc14062c1705e850754fd317a5eee95
parent41ff73882fb6dad2484d841ed59494f0c963bf5e (diff)
parentfed3245aef5333e535d10cca976a3d09a8760446 (diff)
downloadvyos-1x-278d3e62f56f5f7b3c25bbe0cab953c64fbe1fc6.tar.gz
vyos-1x-278d3e62f56f5f7b3c25bbe0cab953c64fbe1fc6.zip
Merge pull request #555 from DmitriyEshenko/cur-1x-pppoe-csid-format
pppoe-server: T2919: Add possibility change Called-Station-Id format
-rw-r--r--data/templates/accel-ppp/pppoe.config.tmpl3
-rw-r--r--interface-definitions/service_pppoe-server.xml.in20
-rwxr-xr-xsrc/conf_mode/service_pppoe-server.py4
3 files changed, 27 insertions, 0 deletions
diff --git a/data/templates/accel-ppp/pppoe.config.tmpl b/data/templates/accel-ppp/pppoe.config.tmpl
index 4af0d9365..bdbd32d33 100644
--- a/data/templates/accel-ppp/pppoe.config.tmpl
+++ b/data/templates/accel-ppp/pppoe.config.tmpl
@@ -186,6 +186,9 @@ vlan-mon={{ interface.name }},{{ interface.vlans | join(',') }}
interface=re:{{ interface.name }}\.\d+
{% endif %}
{% endfor -%}
+{% if radius_called_sid_format %}
+called-sid={{ radius_called_sid_format }}
+{% endif %}
{% endif -%}
{% if svc_name %}
diff --git a/interface-definitions/service_pppoe-server.xml.in b/interface-definitions/service_pppoe-server.xml.in
index 64fd6e4ef..eaaac0d4c 100644
--- a/interface-definitions/service_pppoe-server.xml.in
+++ b/interface-definitions/service_pppoe-server.xml.in
@@ -135,6 +135,26 @@
</leafNode>
</children>
</node>
+ <leafNode name="called-sid-format">
+ <properties>
+ <help>Format of Called-Station-Id attribute</help>
+ <completionHelp>
+ <list>ifname ifname:mac</list>
+ </completionHelp>
+ <constraint>
+ <regex>(ifname|ifname:mac)</regex>
+ </constraint>
+ <constraintErrorMessage>Invalid Called-Station-Id format</constraintErrorMessage>
+ <valueHelp>
+ <format>ifname</format>
+ <description>NAS-Port-Id - should contain root interface name (NAS-Port-Id=eth1)</description>
+ </valueHelp>
+ <valueHelp>
+ <format>ifname:mac</format>
+ <description>NAS-Port-Id - should contain root interface name and mac address (NAS-Port-Id=eth1:00:00:00:00:00:00)</description>
+ </valueHelp>
+ </properties>
+ </leafNode>
</children>
</node>
<leafNode name="protocols">
diff --git a/src/conf_mode/service_pppoe-server.py b/src/conf_mode/service_pppoe-server.py
index a4e937b1a..9935b166f 100755
--- a/src/conf_mode/service_pppoe-server.py
+++ b/src/conf_mode/service_pppoe-server.py
@@ -82,6 +82,7 @@ default_config_data = {
'radius_shaper_attr': '',
'radius_shaper_vendor': '',
'radius_dynamic_author': '',
+ 'radius_called_sid_format': '',
'sesscrtl': 'replace',
'snmp': False,
'thread_cnt': get_half_cpus()
@@ -315,6 +316,9 @@ def get_config(config=None):
pppoe['radius_dynamic_author'] = dae
+ if conf.exists(['called-sid-format']):
+ pppoe['radius_called_sid_format'] = conf.return_value(['called-sid-format'])
+
# RADIUS based rate-limiter
if conf.exists(['rate-limit', 'enable']):
pppoe['radius_shaper_attr'] = 'Filter-Id'