Fix Nanostation M2 ethernet #122
|
@ -1,7 +1,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=fff-network
|
PKG_NAME:=fff-network
|
||||||
PKG_RELEASE:=31
|
PKG_RELEASE:=33
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
|
|
@ -118,12 +118,12 @@ if [ "$ONE_PORT" = "YES" ] && ( ! uci -q get network.$SWITCHDEV.ifname || [ "$FO
|
||||||
uci set network.client.ifname="bat0"
|
uci set network.client.ifname="bat0"
|
||||||
uci set network.wan.ifname="$WANDEV"
|
uci set network.wan.ifname="$WANDEV"
|
||||||
uci del network.ethmesh.ifname
|
uci del network.ethmesh.ifname
|
||||||
uci del network.eth0.macaddr
|
uci del network.${SWITCHDEV}.macaddr
|
||||||
elif [ "$ETHMODE" = "CLIENT" ] ; then
|
elif [ "$ETHMODE" = "CLIENT" ] ; then
|
||||||
uci set network.client.ifname="bat0 $SWITCHDEV"
|
uci set network.client.ifname="bat0 $SWITCHDEV"
|
||||||
uci set network.wan.ifname="eth2" #eth2 because it is default in config file
|
uci set network.wan.ifname="eth2" #eth2 because it is default in config file
|
||||||
uci del network.ethmesh.ifname
|
uci del network.ethmesh.ifname
|
||||||
uci del network.eth0.macaddr
|
uci del network.${SWITCHDEV}.macaddr
|
||||||
elif [ "$ETHMODE" = "BATMAN" ] ; then
|
elif [ "$ETHMODE" = "BATMAN" ] ; then
|
||||||
uci set network.client.ifname="bat0"
|
uci set network.client.ifname="bat0"
|
||||||
uci set network.wan.ifname="eth2" #eth2 because it is default in config file
|
uci set network.wan.ifname="eth2" #eth2 because it is default in config file
|
||||||
|
@ -172,14 +172,14 @@ if [ -n "$ROUTERMAC" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$ETH0MAC" ]; then
|
if [ -n "$ETH0MAC" ]; then
|
||||||
echo "Fixing MAC on eth0"
|
echo "Fixing MAC on $SWITCHDEV"
|
||||||
sleep 10
|
sleep 10
|
||||||
NEW_MACADDR=$(cat "/sys/class/net/${ETH0MAC}/address")
|
NEW_MACADDR=$(cat "/sys/class/net/${ETH0MAC}/address")
|
||||||
uci set network.eth0.macaddr=$NEW_MACADDR
|
uci set network.${SWITCHDEV}.macaddr=$NEW_MACADDR
|
||||||
uci commit network
|
uci commit network
|
||||||
ifconfig eth0 down
|
ifconfig $SWITCHDEV down
|
||||||
ifconfig eth0 hw ether $NEW_MACADDR
|
ifconfig $SWITCHDEV hw ether $NEW_MACADDR
|
||||||
ifconfig eth0 up
|
ifconfig $SWITCHDEV up
|
||||||
/etc/init.d/network restart
|
/etc/init.d/network restart
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
WANDEV=eth0
|
WANDEV=eth1
|
||||||
SWITCHDEV=eth0
|
SWITCHDEV=eth1
|
||||||
CLIENT_PORTS=""
|
CLIENT_PORTS=""
|
||||||
WAN_PORTS=""
|
WAN_PORTS=""
|
||||||
BATMAN_PORTS=""
|
BATMAN_PORTS=""
|
||||||
|
|
Loading…
Reference in New Issue