From 4530f93ede4271287f7538ac244e268100a10f64 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 8 Mar 2015 22:09:51 +0100 Subject: [PATCH] freifunk: Allow adding physical interfaces and disable IPv6 autoconf --- src/initscripts/init.d/lib-freifunk | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/initscripts/init.d/lib-freifunk b/src/initscripts/init.d/lib-freifunk index 2365e3c473..426fba9990 100755 --- a/src/initscripts/init.d/lib-freifunk +++ b/src/initscripts/init.d/lib-freifunk @@ -22,6 +22,9 @@ function freifunk_start() { freifunk_bridge_create freifunk_bridge_attach "${BATMAN_INTERFACE}" + # Attach all other interfaces + freifunk_attach_all_interfaces + # Make sure that alfred is started /etc/init.d/alfred start &>/dev/null } @@ -99,10 +102,34 @@ function freifunk_ipv6_enable() { local device="${1}" sysctl -w "net.ipv6.conf.${device}.disable_ipv6=0" >/dev/null + + # Disable autoconf because we do not need and want IPFire + # to get a globally routed prefix. + sysctl -w "net.ipv6.conf.${device}.autoconf=0" >/dev/null } function freifunk_ipv6_disable() { local device="${1}" sysctl -w "net.ipv6.conf.${device}.disable_ipv6=1" >/dev/null + sysctl -w "net.ipv6.conf.${device}.autoconf=1" >/dev/null +} + +function freifunk_attach_all_interfaces() { + local address + local interface + local mesh + + for mesh in FREIFUNK1 FREIFUNK2 FREIFUNK3 FREIFUNK4; do + local interface_var="${mesh}_DEV" + interface="${!interface_var}" + + [ -n "${interface}" ] || continue + + # Continue if $interface does not exist + [ -d "/sys/class/net/${interface}" ] || continue + + # Attach the device to the bridge + freifunk_bridge_attach "${interface}" + done } -- 2.39.5