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

Hauke Mehrtens hauke at hauke-m.de
Sun Oct 14 16:47:27 EDT 2018


On 10/13/2018 08:31 PM, Linus Walleij wrote:
> 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

There is a typo in your script, it should be
ucidef_set_interfaces_lan_wan, with an s and not
ucidef_set_interface_lan_wan.

Hauke

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20181014/f39d4cfa/attachment.sig>
-------------- next part --------------
_______________________________________________
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