diff --git a/bsp/default/root_file_system/etc/network.sh b/bsp/default/root_file_system/etc/network.sh index f1d43f4..24a30b9 100644 --- a/bsp/default/root_file_system/etc/network.sh +++ b/bsp/default/root_file_system/etc/network.sh @@ -5,13 +5,17 @@ if ! uci get nodewatcher.@network[0].client_interfaces; then fi if ! uci get network.$SWITCHDEV.ifname; then + + SWITCHHW=$(swconfig list | awk '{ print $4 }') + uci set network.$SWITCHDEV=switch + uci set network.$SWITCHDEV.name=$SWITCHHW uci set network.$SWITCHDEV.enable=1 uci set network.$SWITCHDEV.reset=1 uci set network.$SWITCHDEV.enable_vlan=1 uci set network.${SWITCHDEV}_1=switch_vlan - uci set network.${SWITCHDEV}_1.device=$SWITCHDEV + uci set network.${SWITCHDEV}_1.device=$SWITCHHW uci set network.${SWITCHDEV}_1.vlan=1 uci set network.${SWITCHDEV}_1.ports="$CLIENT_PORTS" @@ -19,7 +23,7 @@ if ! uci get network.$SWITCHDEV.ifname; then if [[ "$WANDEV" = "$SWITCHDEV" ]]; then uci set network.${SWITCHDEV}_2=switch_vlan - uci set network.${SWITCHDEV}_2.device=$SWITCHDEV + uci set network.${SWITCHDEV}_2.device=$SWITCHHW uci set network.${SWITCHDEV}_2.vlan=2 uci set network.${SWITCHDEV}_2.ports="$WAN_PORTS" @@ -35,7 +39,7 @@ if ! uci get network.$SWITCHDEV.ifname; then fi uci set network.${SWITCHDEV}_3=switch_vlan - uci set network.${SWITCHDEV}_3.device=$SWITCHDEV + uci set network.${SWITCHDEV}_3.device=$SWITCHHW uci set network.${SWITCHDEV}_3.vlan=3 uci set network.${SWITCHDEV}_3.ports="$BATMAN_PORTS"