contrib/meshwizard: Add radvd config for interfaces, fix firewall rules for dhcpv6
authorManuel Munz <freifunk@somakoma.de>
Tue, 5 Jun 2012 23:13:46 +0000 (23:13 +0000)
committerManuel Munz <freifunk@somakoma.de>
Tue, 5 Jun 2012 23:13:46 +0000 (23:13 +0000)
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_radvd_interface.sh [new file with mode: 0755]
contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh

index fb2232e9961e94ab2ad751d0966b03a7aac98119..33ff9a2bd9330fdd7a8173da84b04a88771c9505 100755 (executable)
@@ -101,11 +101,11 @@ done
 # If we use auto-ipv6-dhcp then allow 547/udp on the freifunk zone
 if [ "$profile_ipv6_config" = "auto-ipv6-dhcpv6" ]; then
        uci batch <<- EOF
-               firewall.dhcpv6=rule
-               firewall.dhcpv6.src=freifunk
-               firewall.dhcpv6.target=ACCEPT
-               firewall.dhcpv6.dest_port=547
-               firewall.dhcpv6.proto=udp
+               set firewall.dhcpv6=rule
+               set firewall.dhcpv6.src=freifunk
+               set firewall.dhcpv6.target=ACCEPT
+               set firewall.dhcpv6.dest_port=547
+               set firewall.dhcpv6.proto=udp
        EOF
 fi
 
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_radvd_interface.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_radvd_interface.sh
new file mode 100755 (executable)
index 0000000..2e13bb7
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Sets up olsrd interfaces
+# arg $1 = net
+
+net=$1
+
+. /lib/functions.sh
+. $dir/functions.sh
+
+uci batch << EOF
+       set radvd.${net}_iface=interface
+       set radvd.${net}_iface.interface="${net}"
+       set radvd.${net}_iface.AdvSendAdvert=1
+       set radvd.${net}_iface.ignore=0
+       set radvd.${net}_prefix=prefix
+       set radvd.${net}_prefix.interface="$net"
+       set radvd.${net}_prefix.ignore=0
+EOF
+
+if [ "$profile_ipv6_config" = "auto-ipv6-dhcpv6" ]; then
+       uci batch <<- EOF
+               set radvd.${net}_iface.AdvManagedFlag=1
+               set radvd.${net}_prefix.AdvOnLink=0
+       EOF
+fi
+
+uci_commitverbose "Setup radvd for interface $net" radvd
index 4bdc2c88f403ad3dba0772a32ca9201c24c706cf..8c9088f073b90caa6468a091203db5487e257442 100755 (executable)
@@ -100,8 +100,14 @@ for net in $networks; do
 
        $dir/helpers/setup_splash.sh $net
        $dir/helpers/setup_firewall_interface.sh $net
+
+       if [ "$profile_ipv6" == 1 ]; then
+               $dir/helpers/setup_radvd_interface.sh $net
+       fi
 done
 
 ##### Reboot the router (because simply restarting services gave errors)
 
+echo "+ The wizard has finished and the router will reboot now."
+
 reboot