From fed3245aef5333e535d10cca976a3d09a8760446 Mon Sep 17 00:00:00 2001 From: DmitriyEshenko Date: Mon, 28 Sep 2020 07:41:19 +0000 Subject: pppoe-server: T2919: Add possibility change Called-Station-Id format --- data/templates/accel-ppp/pppoe.config.tmpl | 3 +++ interface-definitions/service_pppoe-server.xml.in | 20 ++++++++++++++++++++ src/conf_mode/service_pppoe-server.py | 4 ++++ 3 files changed, 27 insertions(+) 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 @@ + + + Format of Called-Station-Id attribute + + ifname ifname:mac + + + (ifname|ifname:mac) + + Invalid Called-Station-Id format + + ifname + NAS-Port-Id - should contain root interface name (NAS-Port-Id=eth1) + + + ifname:mac + NAS-Port-Id - should contain root interface name and mac address (NAS-Port-Id=eth1:00:00:00:00:00:00) + + + 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' -- cgit v1.2.3