From patchwork Sat Sep 2 09:58:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC] Configure the Node a routable ula v6 From: Christian Dresel X-Patchwork-Id: 462 Message-Id: <1504346319-18807-1-git-send-email-fff@chrisi01.de> To: franken-dev@freifunk.net Date: Sat, 2 Sep 2017 11:58:39 +0200 this is only a RFC and untested, i need a litte bit feeback about this. Signed-off-by: Christian Dresel --- .../fff/fff-hoods/files/usr/sbin/configurehood | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood index bbd2f5e..6b6f696 100755 --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood @@ -167,6 +167,24 @@ if [ "$sumnew" != "$sumold" ]; then fi done + # now we load the prefix from the hoodfile and set this to br-mesh + + json_load "$(cat /tmp/keyxchangev2data)" + 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 + echo "Loading wifi" wifi