summaryrefslogtreecommitdiff
path: root/data/templates/frr/staticd.frr.j2
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-19 19:59:34 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-19 20:01:01 +0200
commitc9b33da5260db44c70e066f61711e61f7341bf1e (patch)
treee9db072297b75e08108fc3837f531b7d63d7db6f /data/templates/frr/staticd.frr.j2
parent07af15bb39f6a52a4fd240f54e22b518908fed53 (diff)
downloadvyos-1x-c9b33da5260db44c70e066f61711e61f7341bf1e.tar.gz
vyos-1x-c9b33da5260db44c70e066f61711e61f7341bf1e.zip
pppoe: static: T4379: bugfix default-route lost after applying additional static routes
Issue is identical to the problem in T3680 (05aa22dcb4ce) which was for DHCP based routes. Once a static route is added to the system, the PPPoE auto-installed default route is lost.
Diffstat (limited to 'data/templates/frr/staticd.frr.j2')
-rw-r--r--data/templates/frr/staticd.frr.j211
1 files changed, 8 insertions, 3 deletions
diff --git a/data/templates/frr/staticd.frr.j2 b/data/templates/frr/staticd.frr.j2
index 08b2a3dab..cf8448f7f 100644
--- a/data/templates/frr/staticd.frr.j2
+++ b/data/templates/frr/staticd.frr.j2
@@ -18,9 +18,14 @@ vrf {{ vrf }}
{# IPv4 default routes from DHCP interfaces #}
{% if dhcp is vyos_defined %}
{% for interface, interface_config in dhcp.items() %}
-{% set next_hop = interface | get_dhcp_router %}
-{% if next_hop is vyos_defined %}
-{{ ip_prefix }} route 0.0.0.0/0 {{ next_hop }} {{ interface }} tag 210 {{ interface_config.distance }}
+{# PPPoE routes behave a bit different ... #}
+{% if interface.startswith('pppoe') and interface_config.default_route is vyos_defined and interface_config.default_route is not vyos_defined('none') %}
+{{ ip_prefix }} route 0.0.0.0/0 {{ interface }} tag 210
+{% else %}
+{% set next_hop = interface | get_dhcp_router %}
+{% if next_hop is vyos_defined %}
+{{ ip_prefix }} route 0.0.0.0/0 {{ next_hop }} {{ interface }} tag 210 {{ interface_config.distance if interface_config.distance is vyos_defined }}
+{% endif %}
{% endif %}
{% endfor %}
{% endif %}