OpenWrt Forum Archive

Topic: Switch Configuration Doesn't load after Power Cycle

The content of this topic has been archived on 24 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I run a TP-Link Archer C20i with openwrt so I can run mwan3 on it, but when I Power Cycle or Reboot the thing, well, swconfig lose it's settings.

This is part of the network file:

config 'switch' 'eth0'
   option 'enable'      '1'
   option 'enable_vlan' '1'
   option 'reset'       '1'

config 'switch_vlan' 'eth0_1'
   option 'vlan'       '1'
   option 'device'     'eth0'
   option 'ports'      '1 2 4 5 6t'

config 'switch_vlan' 'eth0_2'
   option 'vlan'       '2'
   option 'device'     'eth0'
   option 'ports'      '0 6t'

config 'switch_vlan' 'eth0_3'
   option 'vlan'       '3'
   option 'device'     'eth0'
   option 'ports'      '3 6t'

When I run swconfig it does work as intended, but again, turn it off, turn it on and it's swconfig time again. and it's an issue. What Did I do wrong or it's something else?

PD: it runs OpenWrt Chaos Calmer 15.05.1

(Last edited by Shyiro on 17 Jun 2017, 03:18)

The switch config itself seems valid, though I rarely see names on the 'switch_vlan' sections. Usually their name is derived from the device + VLAN combo.

How do you determine that it is really swconfig that is not working? After a power cycle, does 'swconfig dev switch0 show' state that you have no VLANs at all?

It resets to the default 2 VLANS the router defaults in, but the network file itself is as I left it in. Also, I Run swconfig and it Does change the VLANS and all, and then, the 2 wan interfaces works as it should, but the moment I power cycle, it's the moment the VLANS resets, and it only works on the original WAN, but the configuration of the WAN2 interface it's still there too.

(Last edited by Shyiro on 17 Jun 2017, 18:28)

Check your switch name. Or simply change switch name from 'eth0' to 'switch0'

Maybe that's what I get wrong, thanks! I ll do it as soon as I wire a serial connection to the thing; tried to FTP the thing and died. Thats why I took so long to reply.

The discussion might have continued from here.