summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinitramfs <initramfs@initramfs.io>2022-08-26 09:17:06 +0800
committerinitramfs <initramfs@initramfs.io>2022-08-27 14:07:28 +0800
commit8285902d3f4eab7038d086df9284eb3d538c693c (patch)
treed0fd5f6962fff34c78e29bdfa8d4a876e8407181
parentbf45a3c86afb532dbf136adda79fdfb402a7e175 (diff)
downloadvyos-1x-8285902d3f4eab7038d086df9284eb3d538c693c.tar.gz
vyos-1x-8285902d3f4eab7038d086df9284eb3d538c693c.zip
pppoe: T4648: stop default route from being installed under IPv6
Adds a sysctl parameter to ignore the default router obtained from router advertisements when pppoe default-route is set to 'none'.
-rw-r--r--data/templates/pppoe/ipv6-up.script.tmpl8
1 files changed, 8 insertions, 0 deletions
diff --git a/data/templates/pppoe/ipv6-up.script.tmpl b/data/templates/pppoe/ipv6-up.script.tmpl
index 7e1bc33b4..238f8c28e 100644
--- a/data/templates/pppoe/ipv6-up.script.tmpl
+++ b/data/templates/pppoe/ipv6-up.script.tmpl
@@ -36,6 +36,14 @@ echo 1 > /proc/sys/net/ipv6/conf/{{ ifname }}/forwarding
#
echo 2 > /proc/sys/net/ipv6/conf/{{ ifname }}/accept_ra
+{% if default_route == 'none' %}
+# Prevent learning of default router from router advertisements
+echo 0 > /proc/sys/net/ipv6/conf/{{ ifname }}/accept_ra_defrtr
+{% else %}
+# Enable learning of default router from router advertisements
+echo 1 > /proc/sys/net/ipv6/conf/{{ ifname }}/accept_ra_defrtr
+{% endif %}
+
# Autoconfigure addresses using Prefix Information in Router Advertisements.
echo 1 > /proc/sys/net/ipv6/conf/{{ ifname }}/autoconf
{% endif %}