diff options
author | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2021-12-15 19:27:26 +0000 |
---|---|---|
committer | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2021-12-15 21:41:50 +0000 |
commit | a43db38e72da8bfebc42d3a0ecedc8ae79383c5d (patch) | |
tree | 222268e29b9f6bb381220aa84da71a9ad7729129 /data/templates/accel-ppp/pppoe.config.tmpl | |
parent | 1b0007a01fd541b5f31ed94518e786a998bd6f43 (diff) | |
download | vyos-1x-a43db38e72da8bfebc42d3a0ecedc8ae79383c5d.tar.gz vyos-1x-a43db38e72da8bfebc42d3a0ecedc8ae79383c5d.zip |
pppoe-server: T3006: Add range to regex generator
Diffstat (limited to 'data/templates/accel-ppp/pppoe.config.tmpl')
-rw-r--r-- | data/templates/accel-ppp/pppoe.config.tmpl | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/data/templates/accel-ppp/pppoe.config.tmpl b/data/templates/accel-ppp/pppoe.config.tmpl index a8ed48a23..a44208e15 100644 --- a/data/templates/accel-ppp/pppoe.config.tmpl +++ b/data/templates/accel-ppp/pppoe.config.tmpl @@ -99,12 +99,22 @@ unit-cache={{ ppp_options.interface_cache }} verbose=1 ac-name={{ access_concentrator }} -{% if interface %} -{% for iface in interface %} +{% if interface is defined and interface is not none %} +{% for iface, iface_config in interface.items() %} +{% if iface_config.vlan_id is not defined and iface_config.vlan_range is not defined %} interface={{ iface }} -{% if interface[iface].vlan_id is defined or interface[iface].vlan_range is defined %} -vlan-mon={{ iface }},{{ interface[iface].vlan_id | join(',') }},{{ interface[iface].vlan_range | join(',') }} -interface=re:{{ interface.name }}\.\d+ +{% endif %} +{% if iface_config.vlan_range is defined %} +{% for regex in iface_config.regex %} +interface=re:^{{ iface | replace('.', '\\.') }}\.({{ regex }})$ +{% endfor %} +vlan-mon={{ iface }},{{ iface_config.vlan_range | join(',') }} +{% endif %} +{% if iface_config.vlan_id is defined %} +{% for vlan in iface_config.vlan_id %} +vlan-mon={{ iface }},{{ vlan }} +interface=re:^{{ iface | replace('.', '\\.') }}\.{{ vlan }}$ +{% endfor %} {% endif %} {% endfor %} {% endif %} |