From patchwork Tue Oct 3 18:58:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,v2] Configure the Node a routable ula v6 From: Adrian Schmutzler X-Patchwork-Id: 520 Message-Id: <1507057102-22820-1-git-send-email-freifunk@adrianschmutzler.de> To: franken-dev@freifunk.net Date: Tue, 3 Oct 2017 20:58:22 +0200 this is only a RFC and untested, i need a litte bit feeback about this. Signed-off-by: Christian Dresel Signed-off-by: Adrian Schmutzler Changes in v2: - Rebased onto keyXchange v2 patchset v15 - correctly handle keyxchangev2data without reloading - added some quotes --- src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood index 29d32a3..28cea1d 100755 --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood @@ -186,6 +186,23 @@ if [ -s /tmp/keyxchangev2data ]; then fi done + # now we load the prefix from the hoodfile and set this to br-mesh + json_select network + json_get_var prefix ula_prefix + # Set $prefix::MAC as IP + suffix="$(awk -F: '{ print $1$2":"$3$4":"$5$6 }' /sys/class/net/br-mesh/address)" + addr="$(echo $prefix | sed -e 's/\//'$suffix'\//')" + for ip in $(ip -6 addr show dev br-mesh | grep inet6 | grep -v fe80:: | grep -v fdff:: | cut -f6 -d " "); do + ip -6 addr del $ip dev br-mesh + done + if [ -n "$(ifconfig br-mesh | grep $addr)" ]; then + ip -6 addr add $addr dev br-mesh + echo "Set ULA adress to br-mesh: $addr" + else + echo "Address already set" + fi + json_select ".." # back to root + echo "Loading wifi" wifi