From 1e4a249f0c56bdd5bf07b1b97844c6aa1d595214 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 16 Sep 2022 23:12:41 +0200 Subject: pppoe-server: T4703: combine vlan-id and vlan-range into single CLI node The initial Accel-PPP PPPoE implementation used: set service pppoe-server interface vlan-id set service pppoe-server interface vlan-range This is actually a duplicated CLI node. --- data/templates/accel-ppp/pppoe.config.j2 | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'data/templates/accel-ppp/pppoe.config.j2') diff --git a/data/templates/accel-ppp/pppoe.config.j2 b/data/templates/accel-ppp/pppoe.config.j2 index 0a92e2d54..f4129d3e2 100644 --- a/data/templates/accel-ppp/pppoe.config.j2 +++ b/data/templates/accel-ppp/pppoe.config.j2 @@ -105,20 +105,13 @@ ac-name={{ access_concentrator }} {% if interface is vyos_defined %} {% for iface, iface_config in interface.items() %} -{% if iface_config.vlan_id is not vyos_defined and iface_config.vlan_range is not vyos_defined %} +{% if iface_config.vlan is not vyos_defined %} interface={{ iface }} -{% endif %} -{% if iface_config.vlan_range is vyos_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 vyos_defined %} -{% for vlan in iface_config.vlan_id %} -vlan-mon={{ iface }},{{ vlan }} -interface=re:^{{ iface | replace('.', '\\.') }}\.{{ vlan }}$ +{% else %} +{% for vlan in iface_config.vlan %} +interface=re:^{{ iface }}\.{{ vlan | range_to_regex }}$ {% endfor %} +vlan-mon={{ iface }},{{ iface_config.vlan | join(',') }} {% endif %} {% endfor %} {% endif %} -- cgit v1.2.3