diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2022-04-04 10:12:08 +0000 |
---|---|---|
committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2022-05-25 14:00:16 +0000 |
commit | e37cd20355949993988b333bad05b1278f4e3dc0 (patch) | |
tree | 2119f845861d6f418b5b28b1278f68a66644473d /data | |
parent | 1678ecdc7bff0ac89b8dfd6608097156f92b9f3a (diff) | |
download | vyos-1x-e37cd20355949993988b333bad05b1278f4e3dc0.tar.gz vyos-1x-e37cd20355949993988b333bad05b1278f4e3dc0.zip |
ipoe: T2580: Add pools and gateway options
Add new feature to allow to use named pools
Can be used also with Radius attribute 'Framed-Pool'
set service ipoe-server client-ip-pool name POOL1 gateway-address '192.0.2.1'
set service ipoe-server client-ip-pool name POOL1 subnet '192.0.2.0/24'
Diffstat (limited to 'data')
-rw-r--r-- | data/templates/accel-ppp/ipoe.config.tmpl | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/data/templates/accel-ppp/ipoe.config.tmpl b/data/templates/accel-ppp/ipoe.config.tmpl index 1cf2ab0be..9fc816a2c 100644 --- a/data/templates/accel-ppp/ipoe.config.tmpl +++ b/data/templates/accel-ppp/ipoe.config.tmpl @@ -24,11 +24,24 @@ level=5 [ipoe] verbose=1 {% for interface in interfaces %} -{% if interface.vlan_mon %} -interface=re:{{ interface.name }}\.\d+,{% else %}interface={{ interface.name }},{% endif %}shared={{ interface.shared }},mode={{ interface.mode }},ifcfg={{ interface.ifcfg }},range={{ interface.range }},start={{ interface.sess_start }},ipv6=1 +{% set ifname = interface.name %} +{% if interface.vlan_mon %} +{% set ifname = 're:' ~ interface.name ~ '\.\d+' %} +{% endif %} +interface={{ ifname }},shared={{ interface.shared }},mode={{ interface.mode }},ifcfg={{ interface.ifcfg }}{{ ',range=' ~ interface.range if interface.range is defined and interface.range is not none }},start={{ interface.sess_start }},ipv6=1 {% endfor %} {% if auth_mode == 'noauth' %} noauth=1 +{% if client_named_ip_pool %} +{% for pool in client_named_ip_pool %} +{% if pool.subnet is defined %} +ip-pool={{ pool.name }} +{% endif %} +{% if pool.gateway_address is defined %} +gw-ip-address={{ pool.gateway_address }}/{{ pool.subnet.split('/')[1] }} +{% endif %} +{% endfor%} +{% endif %} {% elif auth_mode == 'local' %} username=ifname password=csid @@ -61,6 +74,18 @@ verbose=1 [ipv6-dhcp] verbose=1 +{% if client_named_ip_pool %} +[ip-pool] +{% for pool in client_named_ip_pool %} +{% if pool.subnet is defined %} +{{ pool.subnet }},name={{ pool.name }} +{% endif %} +{% if pool.gateway_address is defined %} +gw-ip-address={{ pool.gateway_address }}/{{ pool.subnet.split('/')[1] }} +{% endif %} +{% endfor%} +{% endif %} + {% if client_ipv6_pool %} [ipv6-pool] {% for p in client_ipv6_pool %} |