Multiwan problem after reboot

Hello!
I use a multiwan configuration, two wan1 and wan2 ports are configured. wan2 was originally a port of lan4. Each wan's connection receives an address through dhcp server. When I reboot the my router (Netgear R6300 V2), all clients on the local network receive addresses from the server through the wan2 port. In this case, after loading the router, the addresses received earlier through wan2 are not changed. You need to constantly manually disconnect and reconnect the cable so that everything works again. If I disconnect the port of wan2 and leave only the port of wan1, then this does not happen. I did not find where you can change the behavior of the switch at the time of loading the router. The only file that is directly responsible for the interfaces I found along the way: /etc/board.json But changing the configuration in this file does not solve the problem. Also, the autostart command /etc/init.d/network restart does not help.
Someone came across this, how to fix it?

/etc/board.json

{
"model": {
"id": "netgear,r6300v2",
"name": "Netgear R6300 V2 (BCM4708)"
},
"switch": {
"switch0": {
"enable": true,
"reset": true,
"ports": [
{
"num": 0,
"role": "lan"
},
{
"num": 1,
"role": "lan"
},
{
"num": 2,
"role": "lan"
},
{
"num": 3,
"role": "wan"
},
{
"num": 4,
"role": "wan"
},
{
"num": 5,
"device": "eth0",
"need_tag": true,
"want_untag": false
}
],
"roles": [
{
"role": "lan",
"ports": "0 1 2 5t",
"device": "eth0.1"
},
{
"role": "wan",
"ports": "3 5t",
"device": "eth0.2"
},
{
"role": "wan",
"ports": "4 5t",
"device": "eth0.3"
}
]
}
},
"network": {
"lan": {
"ifname": "eth0.1",
"protocol": "static"
},
"wan": {
"ifname": "eth0.2",
"protocol": "dhcp",
"macaddr": "10:da:43:95:69:79"
},
"wan": {
"ifname": "eth0.3",
"protocol": "dhcp",
"macaddr": "10:da:43:95:69:80"
}
}
}

/etc/network

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fd79:bf47:3778::/48'

config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option igmp_snooping '1'
option igmp_v3 '1'
option ip6assign '48'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
option igmp_snooping '1'
option igmp_v3 '1'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '5t 0 1 2'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '5t 4'

config switch_vlan
option device 'switch0'
option ports '5t 3'
option vlan '3'

config interface 'wan_14'
option ifname 'eth0.2'
option proto 'dhcp'
option force_link '1'
option metric '14'
option ip4table '254'
option ipv6 '1'

config interface 'wan_24'
option ifname 'eth0.3'
option proto 'dhcp'
option force_link '1'
option metric '24'
option ip4table '254'
option ipv6 '1'

config interface 'wan_16'
option ifname 'eth0.2'
option proto 'dhcpv6'
option force_link '1'
option reqprefix '48'
option reqaddress 'try'
option metric '16'
option ip6table '254'
option ipv6 '1'

config interface 'wan_26'
option ifname 'eth0.3'
option proto 'dhcpv6'
option force_link '1'
option reqprefix '48'
option reqaddress 'try'
option metric '26'
option ip6table '254'
option ipv6 '1'

This is a common problem for most of the cheap routers with or without switch. During boot they work like a hub forwarding every packet on every port.
A long lease time on the dhcp server could help in this case.

Thanks for the answer.
The thing is that with the wan interface, which is configured by default immediately after installing the firmware, this does not happen. Also, I did not observe such behavior when using firmware from a tomato or dd-vrt. Perhaps when configuring through lucy, some configuration files are skipped?

There is no configuration for this behavior. If you search the forum you'll see other users with the same problem.


I tried to write a script that would turn off the ports for a few seconds after loading the router, but I did not succeed. Example:

"disable: ssh> swconfig dev switch0 port 4 set disable 1
enable: ssh> swconfig dev switch0 port 4 set disable 0"

unfortunately does not work. Because the switch BCM53011 does not support the "port xxx set disable" commands.

Are there any other ways you can disable and re-enable ports after the router boots up?

swconfig dev switch0 help

/etc/config$ swconfig dev switch0 help
switch0: bcm53011(BCM53011), ports: 9 (cpu @ 5), vlans: 4096
--switch
Attribute 1 (int): enable_vlan (Enable VLAN mode)
Attribute 2 (string): ports (Available Ports (as bitmask))
Attribute 3 (int): reset_mib (Reset MIB counters)
Attribute 4 (int): enable_jumbo (Enable Jumbo Frames)
Attribute 5 (int): allow_vid_4095 (Allow VID 4095)
Attribute 6 (none): apply (Activate changes in the hardware)
Attribute 7 (none): reset (Reset the switch)
--vlan
Attribute 1 (ports): ports (VLAN port mapping)
--port
Attribute 1 (string): mib (Get port's MIB counters)
Attribute 2 (int): pvid (Primary VLAN ID)
Attribute 3 (unknown): link (Get port link information)