summaryrefslogtreecommitdiff
path: root/data/templates/pppoe/ip-down.script.tmpl
diff options
context:
space:
mode:
authorSam Burney <sburney@sifnt.net.au>2021-01-30 08:44:09 +0000
committerChristian Poessinger <christian@poessinger.com>2021-01-30 21:24:16 +0100
commit8b66542afd8807fb75b098cdfa99ddd159ea6561 (patch)
treefdaa73e81f4d3455e07db83221a226b9a5bf9d1d /data/templates/pppoe/ip-down.script.tmpl
parent3e9a2095cc582674e30229d3d341de47d3ce1e10 (diff)
downloadvyos-1x-8b66542afd8807fb75b098cdfa99ddd159ea6561.tar.gz
vyos-1x-8b66542afd8807fb75b098cdfa99ddd159ea6561.zip
pppoe: T3273: Leave default-route in place if 'default-route' is set to 'none'
(cherry picked from commit 2dc11253e46b945adb392c5946fd9ad43f391d86)
Diffstat (limited to 'data/templates/pppoe/ip-down.script.tmpl')
-rw-r--r--data/templates/pppoe/ip-down.script.tmpl6
1 files changed, 4 insertions, 2 deletions
diff --git a/data/templates/pppoe/ip-down.script.tmpl b/data/templates/pppoe/ip-down.script.tmpl
index 5e119f796..bac4155d6 100644
--- a/data/templates/pppoe/ip-down.script.tmpl
+++ b/data/templates/pppoe/ip-down.script.tmpl
@@ -23,10 +23,12 @@ if [ -d /sys/class/net/{{ ifname }}/upper_* ]; then
VRF_NAME="vrf ${VRF_NAME}"
fi
-# Always delete default route when interface goes down
+{% if default_route != 'none' %}
+# Always delete default route when interface goes down if we installed it
vtysh -c "conf t" ${VRF_NAME} -c "no ip route 0.0.0.0/0 {{ ifname }} ${VRF_NAME}"
-{% if ipv6 is defined and ipv6.address is defined and ipv6.address.autoconf is defined %}
+{% if ipv6 is defined and ipv6.address is defined and ipv6.address.autoconf is defined %}
vtysh -c "conf t" ${VRF_NAME} -c "no ipv6 route ::/0 {{ ifname }} ${VRF_NAME}"
+{% endif %}
{% endif %}
{% endif %}