diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-12-15 22:51:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-15 22:51:30 +0100 |
commit | 5d6726b04c49f97814e1a39149df03b3a785938e (patch) | |
tree | 7649ed5025d40f9deba2df2147fcc1772c1acdf3 /data | |
parent | a56cc7ea419241dab9d26aa2d9046c6bf32cf026 (diff) | |
parent | a43db38e72da8bfebc42d3a0ecedc8ae79383c5d (diff) | |
download | vyos-1x-5d6726b04c49f97814e1a39149df03b3a785938e.tar.gz vyos-1x-5d6726b04c49f97814e1a39149df03b3a785938e.zip |
Merge pull request #1106 from DmitriyEshenko/equuleus-15122021
pppoe-server: T3006: Add range to regex generator
Diffstat (limited to 'data')
-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 %} |