2015-01-18 22:05:52 +01:00
|
|
|
WANDEV=eth0
|
|
|
|
SWITCHDEV=eth0
|
|
|
|
CLIENT_PORTS=""
|
|
|
|
WAN_PORTS=""
|
|
|
|
BATMAN_PORTS=""
|
|
|
|
|
2015-09-21 23:02:05 +02:00
|
|
|
. /etc/network.mode
|
|
|
|
|
2015-01-18 22:05:52 +01:00
|
|
|
ETHMESHMAC=
|
|
|
|
ROUTERMAC=w2mesh
|
|
|
|
|
|
|
|
uci set network.$SWITCHDEV=interface
|
|
|
|
uci set network.$SWITCHDEV.ifname=$SWITCHDEV
|
|
|
|
uci set network.mesh.ifname="bat0"
|
|
|
|
|
2015-09-21 23:02:05 +02:00
|
|
|
if [ "$ETHMODE" = "WAN" ] ; then
|
|
|
|
## Activate for WAN:
|
|
|
|
echo "net.ipv6.conf.$WANDEV.accept_ra_defrtr = 1" >> /etc/sysctl.conf
|
|
|
|
echo "net.ipv6.conf.$WANDEV.accept_ra_pinfo = 1" >> /etc/sysctl.conf
|
|
|
|
echo "net.ipv6.conf.$WANDEV.autoconf = 1" >> /etc/sysctl.conf
|
|
|
|
echo "net.ipv6.conf.$WANDEV.accept_ra_rtr_pref = 1" >> /etc/sysctl.conf
|
|
|
|
uci set network.wan.ifname=$WANDEV
|
|
|
|
elif [ "$ETHMODE" = "CLIENT" ] ; then
|
|
|
|
## Activate Client:
|
|
|
|
uci set network.mesh.ifname="bat0 $SWITCHDEV"
|
|
|
|
else
|
|
|
|
## Activate BATMAN:
|
|
|
|
uci set network.ethmesh.ifname="$SWITCHDEV"
|
|
|
|
fi
|