From 8285902d3f4eab7038d086df9284eb3d538c693c Mon Sep 17 00:00:00 2001
From: initramfs <initramfs@initramfs.io>
Date: Fri, 26 Aug 2022 09:17:06 +0800
Subject: 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'.
---
 data/templates/pppoe/ipv6-up.script.tmpl | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'data')

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 %}
-- 
cgit v1.2.3