forked from freifunk-franken/firmware
splits configuration and implementation for different ubnt setups
* introduces new file network.mode currently only used for nanostation * network.mode is added to sysupgrade.conf => once configured the the setting should survive an upgrade Reviewed-by: Tim Niemeyer <tim.niemeyer@mastersword.de>
This commit is contained in:
parent
4739251fff
commit
53257078c9
|
@ -1 +1,2 @@
|
||||||
/etc/shadow
|
/etc/shadow
|
||||||
|
/etc/network.mode
|
||||||
|
|
18
bsp/ubnt-nano-m/root_file_system/etc/network.mode
Normal file
18
bsp/ubnt-nano-m/root_file_system/etc/network.mode
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#what should the one eth0 ethernet port be used for?
|
||||||
|
#directly connect to other mesh nodes - this is the default
|
||||||
|
ETHMODE="BATMAN"
|
||||||
|
|
||||||
|
#Connect with fastd vpn
|
||||||
|
#ETHMODE="WAN"
|
||||||
|
|
||||||
|
#connect normal ff-clients
|
||||||
|
#ETHMODE="CLIENT"
|
||||||
|
|
||||||
|
################
|
||||||
|
## If you want to change the behavior of eth0, you can change it above.
|
||||||
|
## After that you have to reset the config with following commands.
|
||||||
|
#cp /rom/etc/sysctl.conf /etc/sysctl.conf
|
||||||
|
#cp /rom/etc/config/network /etc/config/network
|
||||||
|
#reboot
|
||||||
|
################
|
||||||
|
|
|
@ -4,6 +4,8 @@ CLIENT_PORTS=""
|
||||||
WAN_PORTS=""
|
WAN_PORTS=""
|
||||||
BATMAN_PORTS=""
|
BATMAN_PORTS=""
|
||||||
|
|
||||||
|
. /etc/network.mode
|
||||||
|
|
||||||
CLIENTIF="w2ap"
|
CLIENTIF="w2ap"
|
||||||
ETHMESHMAC=
|
ETHMESHMAC=
|
||||||
ROUTERMAC=w2mesh
|
ROUTERMAC=w2mesh
|
||||||
|
@ -12,24 +14,18 @@ uci set network.$SWITCHDEV=interface
|
||||||
uci set network.$SWITCHDEV.ifname=$SWITCHDEV
|
uci set network.$SWITCHDEV.ifname=$SWITCHDEV
|
||||||
uci set network.mesh.ifname="bat0"
|
uci set network.mesh.ifname="bat0"
|
||||||
|
|
||||||
################
|
if [ "$ETHMODE" = "WAN" ] ; then
|
||||||
## If you want to change the behavior of eth0, you can change it here.
|
## Activate for WAN:
|
||||||
## After that you have to reset the config with following commands.
|
echo "net.ipv6.conf.$WANDEV.accept_ra_defrtr = 1" >> /etc/sysctl.conf
|
||||||
#cp /rom/etc/sysctl.conf /etc/sysctl.conf
|
echo "net.ipv6.conf.$WANDEV.accept_ra_pinfo = 1" >> /etc/sysctl.conf
|
||||||
#cp /rom/etc/config/network /etc/config/network
|
echo "net.ipv6.conf.$WANDEV.autoconf = 1" >> /etc/sysctl.conf
|
||||||
#reboot
|
echo "net.ipv6.conf.$WANDEV.accept_ra_rtr_pref = 1" >> /etc/sysctl.conf
|
||||||
################
|
uci set network.wan.ifname=$WANDEV
|
||||||
|
elif [ "$ETHMODE" = "CLIENT" ] ; then
|
||||||
## Activate for WAN:
|
## Activate Client:
|
||||||
#echo "net.ipv6.conf.$WANDEV.accept_ra_defrtr = 1" >> /etc/sysctl.conf
|
CLIENTIF="w2ap eth0"
|
||||||
#echo "net.ipv6.conf.$WANDEV.accept_ra_pinfo = 1" >> /etc/sysctl.conf
|
uci set network.mesh.ifname="bat0 $SWITCHDEV"
|
||||||
#echo "net.ipv6.conf.$WANDEV.autoconf = 1" >> /etc/sysctl.conf
|
else
|
||||||
#echo "net.ipv6.conf.$WANDEV.accept_ra_rtr_pref = 1" >> /etc/sysctl.conf
|
## Activate BATMAN:
|
||||||
#uci set network.wan.ifname=$WANDEV
|
uci set network.ethmesh.ifname="$SWITCHDEV"
|
||||||
|
fi
|
||||||
## Activate for BATMAN:
|
|
||||||
uci set network.ethmesh.ifname="$SWITCHDEV"
|
|
||||||
|
|
||||||
## Activate for Client:
|
|
||||||
#CLIENTIF="w2ap eth0"
|
|
||||||
#uci set network.mesh.ifname="bat0 $SWITCHDEV"
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user