[PATCH] fff-network: Improve IPv6 WAN connectivity

Fabian Bläse fabian at blaese.de
So Jun 14 13:17:04 CEST 2020


Until now, IPv6 connectivity was only ensured by some custom sysctls.
OpenWrt has a proper way of enabling IPv6 client (SLAAC, as well as DHCPv6)
for an interface. Switching to OpenWrt's way of configuring client addresses
for an interface might also make configuration more reliable, as the appropriate
sysctls are now set by netifd. Especially OnePort and TwoPort devices will
benefit from this change, as IPv6 auto configuration does not have to be manually
enabled and disabled for a physical interface, but rather is set as an option for
our logical wan interface.

At the same time this change enables DHCPv6 client support for WAN.

Signed-off-by: Fabian Bläse <fabian at blaese.de>
---
 src/packages/fff/fff-network/files/etc/config/network    | 5 +++++
 .../fff/fff-network/files/usr/sbin/configurenetwork      | 9 +--------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/packages/fff/fff-network/files/etc/config/network b/src/packages/fff/fff-network/files/etc/config/network
index d2ee443..1f56ce5 100644
--- a/src/packages/fff/fff-network/files/etc/config/network
+++ b/src/packages/fff/fff-network/files/etc/config/network
@@ -12,6 +12,11 @@ config interface 'wan'
         option proto 'dhcp'
         option ifname 'eth1'
 
+config interface 'wan6'
+        option proto 'dhcpv6'
+        option reqprefix 'no'
+        option ifname '@wan'
+
 config interface 'ethmesh'
         option proto 'batadv_hardif'
         option master 'bat0'
diff --git a/src/packages/fff/fff-network/files/usr/sbin/configurenetwork b/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
index 0ae7ba8..4bbc4f1 100755
--- a/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
+++ b/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
@@ -126,11 +126,7 @@ if ! uci -q get network.$SWITCHDEV > /dev/null || [ "$FORCEPARSE" = '1' ] ; then
         uci set network.${SWITCHDEV}_2.vlan=2
         uci set network.${SWITCHDEV}_2.ports="$WAN_PORTS"
 
-        enableAutoConf "$WANDEV.2"
-    else
-        enableAutoConf "$WANDEV"
-    fi
-    
+
     uci set network.${SWITCHDEV}_3=switch_vlan
     uci set network.${SWITCHDEV}_3.device=$SWITCHHW
     uci set network.${SWITCHDEV}_3.vlan=3
@@ -153,19 +149,16 @@ if [ "$ONE_PORT" = "YES" ] && ( ! uci -q get network.$SWITCHDEV.ifname || [ "$FO
     uci set network.$SWITCHDEV=interface
     uci set network.$SWITCHDEV.ifname=$SWITCHDEV
     if [ "$ETHMODE" = "WAN" ]; then
-        enableAutoConf "$WANDEV"
         uci set network.mesh.ifname="bat0"
         uci set network.wan.ifname="$WANDEV"
         uci del uci set network.ethmesh.ifname
         uci del network.eth0.macaddr
     elif [ "$ETHMODE" = "CLIENT" ] ; then
-        disableAutoConf "$WANDEV"
         uci set network.mesh.ifname="bat0 $SWITCHDEV"
         uci set network.wan.ifname="eth1" #eth1 because it is default in config file
         uci del network.ethmesh.ifname
         uci del network.eth0.macaddr
     elif [ "$ETHMODE" = "BATMAN" ] ; then
-        disableAutoConf "$WANDEV"
         uci set network.mesh.ifname="bat0"
         uci set network.wan.ifname="eth1" #eth1 because it is default in config file
         uci set network.ethmesh.ifname="$SWITCHDEV"
-- 
2.27.0



Mehr Informationen über die Mailingliste franken-dev