[OpenWrt-Devel] Right 02_network script for DSA switched boards (v4.19)

Linus Walleij linus.walleij at linaro.org
Sat Oct 13 14:31:39 EDT 2018


Hi,

I'm having trouble figuring out how to get a proper DSA switch
up with a 02_network script. NB: this is on a newer kernel
v4.19+patches just using DSA for the switches, no switchdev!

These platforms (gemini) have eth0 and eth1, sometimes LAN
is on eth1 and WAN on eth0 to complicate things.
I used to ifconfig everything in place.

The below mostly get things right at bootstrap, so eth1 comes
up as LAN (192.168.1.1) and eth0 as WAN.

But it does not bring the DSA child interfaces online ("lan1"
thru "lan4" and "wan"). I can do it manually of course. But that
is not very good for a default install :(

Any hints for how to make the DSA children go online
automatically after eth0/eth1 (the CPU ports) come online?

#!/bin/sh

. /lib/functions/uci-defaults.sh

board_config_update

board=$(board_name)

case "$board" in
storlink,gemini324)
      # These are all connected to eth1 thru VSC7385
    ucidef_set_interface_lan_wan "lan1 lan2 lan3 lan4" "eth0"
    ;;
itian,sq201)
    # These are all connected to eth1 thru VSC7395x
    ucidef_set_interface_lan_wan "lan1 lan2 lan3 lan4" "eth0"
    ;;
dlink,dir-685)
    # These are all connected to eth0 thru RTL8366RB
    ucidef_set_interface_lan_wan "lan0 lan1 lan2 lan3" "wan"
    ;;
esac

exit 0

Yours,
Linus Walleij

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list