summaryrefslogtreecommitdiff
path: root/data/templates/accel-ppp
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-03-07 08:44:30 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2023-03-07 08:44:30 +0000
commitdf82afa755454179d9699a9f1488477bdb84ec5d (patch)
tree012f07806d5db8355cc6f1c4a99a923b3d4c6299 /data/templates/accel-ppp
parent14bca4e80c4d0773ada6862f732c2f1495594239 (diff)
downloadvyos-1x-df82afa755454179d9699a9f1488477bdb84ec5d.tar.gz
vyos-1x-df82afa755454179d9699a9f1488477bdb84ec5d.zip
T5057: Fix IPoE regex Jinja2 for interface
Fix incorrect regex '\d+' when used vlan ranges For example 'ipoe-server interface eth1 vlan 2000-3000' - replace 'interface=re:eth1\.\d+' => 'interface=re:^eth1\.(200\d|20[1-9]\d|2[1-9]\d{2}|3000)$'
Diffstat (limited to 'data/templates/accel-ppp')
-rw-r--r--data/templates/accel-ppp/ipoe.config.j211
1 files changed, 4 insertions, 7 deletions
diff --git a/data/templates/accel-ppp/ipoe.config.j2 b/data/templates/accel-ppp/ipoe.config.j2
index 179f2277b..2a2367b69 100644
--- a/data/templates/accel-ppp/ipoe.config.j2
+++ b/data/templates/accel-ppp/ipoe.config.j2
@@ -25,7 +25,7 @@ verbose=1
{% for iface, iface_config in interface.items() %}
{% set tmp = 'interface=' %}
{% if iface_config.vlan is vyos_defined %}
-{% set tmp = tmp ~ 're:' ~ iface ~ '\.\d+' %}
+{% set tmp = tmp ~ 're:^' ~ iface ~ '\.' ~ iface_config.vlan | range_to_regex ~ '$' %}
{% else %}
{% set tmp = tmp ~ iface %}
{% endif %}
@@ -36,6 +36,9 @@ verbose=1
{% set shared = 'shared=0,' %}
{% endif %}
{{ tmp }},{{ shared }}mode={{ iface_config.mode | upper }},ifcfg=1,range={{ iface_config.client_subnet }},start=dhcpv4,ipv6=1
+{% if iface_config.vlan is vyos_defined %}
+vlan-mon={{ iface }},{{ iface_config.vlan | join(',') }}
+{% endif %}
{% endfor %}
{% endif %}
{% if authentication.mode is vyos_defined('noauth') %}
@@ -54,12 +57,6 @@ password=csid
{% endif %}
proxy-arp=1
-{% for iface, iface_options in interface.items() %}
-{% if iface_options.network is vyos_defined('vlan') %}
-vlan-mon={{ iface }},{{ iface_options.vlan | join(',') }}
-{% endif %}
-{% endfor %}
-
{% if client_ip_pool.name is vyos_defined %}
[ip-pool]
{% for pool, pool_options in client_ip_pool.name.items() %}