summaryrefslogtreecommitdiff
path: root/data/templates/accel-ppp/ipoe.config.j2
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-03-23 18:16:16 +0100
committerGitHub <noreply@github.com>2023-03-23 18:16:16 +0100
commitb49c10c43266b053ff662cde8bbd110e17767a2b (patch)
tree390b3b6c3f47c45a28c16e071a96625dfc030aaf /data/templates/accel-ppp/ipoe.config.j2
parent63f735891741ed71bff357cf570b00543365d981 (diff)
parent7cb95a6bc9801abcc70f8d4cfbcc79718148de1c (diff)
downloadvyos-1x-b49c10c43266b053ff662cde8bbd110e17767a2b.tar.gz
vyos-1x-b49c10c43266b053ff662cde8bbd110e17767a2b.zip
Merge pull request #1901 from sever-sever/T5099
T5099: IPoE-server add option next-pool for named ip pools
Diffstat (limited to 'data/templates/accel-ppp/ipoe.config.j2')
-rw-r--r--data/templates/accel-ppp/ipoe.config.j227
1 files changed, 20 insertions, 7 deletions
diff --git a/data/templates/accel-ppp/ipoe.config.j2 b/data/templates/accel-ppp/ipoe.config.j2
index ac83c3dbd..add3dc7e4 100644
--- a/data/templates/accel-ppp/ipoe.config.j2
+++ b/data/templates/accel-ppp/ipoe.config.j2
@@ -49,22 +49,35 @@ username=ifname
password=csid
{% endif %}
{% if client_ip_pool.name is vyos_defined %}
-{% for pool, pool_options in client_ip_pool.name.items() %}
-{% if pool_options.subnet is vyos_defined and pool_options.gateway_address is vyos_defined %}
+{% if first_named_pool is vyos_defined %}
+ip-pool={{ first_named_pool }}
+{% else %}
+{% for pool, pool_options in client_ip_pool.name.items() %}
+{% if pool_options.subnet is vyos_defined %}
ip-pool={{ pool }}
+{% endif %}
+{% endfor %}
+{% endif %}
+{% for pool, pool_options in client_ip_pool.name.items() %}
+{% if pool_options.gateway_address is vyos_defined %}
gw-ip-address={{ pool_options.gateway_address }}/{{ pool_options.subnet.split('/')[1] }}
{% endif %}
{% endfor %}
{% endif %}
proxy-arp=1
-{% if client_ip_pool.name is vyos_defined %}
+{% if ordered_named_pools is vyos_defined %}
[ip-pool]
-{% for pool, pool_options in client_ip_pool.name.items() %}
-{% if pool_options.subnet is vyos_defined and pool_options.gateway_address is vyos_defined %}
-{{ pool_options.subnet }},name={{ pool }}
+{% for p in ordered_named_pools %}
+{% for pool, pool_options in p.items() %}
+{% set next_named_pool = ',next=' ~ pool_options.next_pool if pool_options.next_pool is vyos_defined else '' %}
+{{ pool_options.subnet }},name={{ pool }}{{ next_named_pool }}
+{% endfor %}
+{% endfor %}
+{% for p in ordered_named_pools %}
+{% for pool, pool_options in p.items() %}
gw-ip-address={{ pool_options.gateway_address }}/{{ pool_options.subnet.split('/')[1] }}
-{% endif %}
+{% endfor %}
{% endfor %}
{% endif %}