Apply Settings can make vlan bridge assignments disappear

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
jimj
DD-WRT Novice


Joined: 18 Oct 2015
Posts: 35
Location: Sioux Falls SD

PostPosted: Mon Jul 19, 2021 1:58    Post subject: Apply Settings can make vlan bridge assignments disappear Reply with quote
I recently got VLANs working on a pair of Netgear R7800 routers. It's a fairly simple config, I have new VLAN 11 assigned to one untagged and one VLAN tagged port on my R7800s. While working on this discovered one thing I didn't notice documented/mentioned anywhere. I found you should use the web "Setup->Networking" page's "Assign to Bridge" section to map your new VLAN interface to your bridge (in addition to mapping it via the Startup commands on the "Administration->Commands" page).

For my setup I add eth1.11 to br1 in the "Setup->Networking" page's "Assign to Bridge" section. If you don't add it on this web page then clicking "Apply Settings" on some pages (like "Setup->Networking" and "Administration->Management") will cause this "eth1.11 to br1" mapping to be lost. However you shouldn't only define this mapping in the GUI, the 'brctl addif br1 eth1.11' startup command is also needed so that eth1.11 is assigned to br1 on start up.

In summary:

  1. Bridge assignments done via the "Setup->Networking" page ensure the mappings aren't lost when you click "Apply Settings" on some web pages
  2. Bridge assignments done via the Startup commands ("Administration->Management" page) ensure the mappings are in place on start up even if you haven't clicked "Apply Settings"
  3. I.e. when you click the "Apply Settings" button on some web pages (like "Setup->Networking" and "Administration->Management") your startup commands bridge assignments are lost! You need the startup commands to define vlans (and you should also assign them to a bridge from the startup commands), but you must also assign vlans to a bridge via the "Setup->Networking" page's "Assign to Bridge" section to ensure they're not lost when you click the "Apply Settings" button on some web pages.


To illustrate this another way, when I first boot I have this bridging table:
Code:
Current Bridging Table
Bridge Name   STP   Interface
br0   no   eth0 eth1 wlan0
br1   no   eth1.11 wlan1


If I do NOT have eth1.11 mapped to br1 in the GUI when I click "Apply Settings" on the "Setup->Networking" (or "Administration->Management") page I'm left with this bridging table (eth1.11 disappears):
Code:
Bridge Name   STP   Interface
br0   no   eth0 eth1 wlan0
br1   no   wlan1


If you watch the "Current Bridging Table" section of the "Setup->Networking" page after clicking "Apply Settings" you can watch the mappings disappear and re-appear (usually without reloading the page), but my eth1.11 mapping is never restored (unless I also map assign it via this web page). You can also watch this from the CLI by run 'brctl show' repeatedly.

This is similar to the "disappearing static ARP entry" described here:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=914040#914040

Note all of these configurations/commands were tested/used on firmware DD-WRT v3.0-r45849 std (02/25/21)

Below are my "Administration->Commands" page Startup commands:
Code:
///r7800-1\\\
### Configure logical switch port 4 (physical port 1) as an 802.1q VLAN tagged port for VLANs 1 (internal) and 11 (guest) ###
# Enable VLANs
swconfig dev switch0 set enable_vlan 1
# Change default LAN VLAN 1 to be tagged on logical switch port 4 (physical port 1)
swconfig dev switch0 vlan 1 set ports "1 2 3 4t 6"
# Add new VLAN 11 to be tagged on logical switch port 4 (physical port 1)
swconfig dev switch0 vlan 11 set ports "4t 6t"
# Activate the new switch configuration
swconfig dev switch0 set apply
## At this point the layer2 configuration is done, logical port 4 is now an 802.1q vlan tagged port
## Below we map this layer2 guest VLAN (11) to the layer3 guest network (configured on br1)
# Create vlan device 11 on interface eth1 (aka eth1.11) for the new VLAN 11
vconfig add eth1 11
# Map eth1.11 to my preexisting guest bridge br1
# Note I also add eth1.11 to br1 in the "Setup->Networking" page's "Assign to Bridge" section.  If you don't add it on this web page then clicking "Apply Settings" on some pages (like "Setup->Networking" and "Administration->Management") will cause this "eth1.11 to br1" mapping to be lost.  This 'brctl addif br1 eth1.11' startup command is also needed so that eth1.11 is assigned to br1 on start up.
brctl addif br1 eth1.11
# Activate network interface eth1.11
ifconfig eth1.11 up
# VLAN configuration is done.  At this point internal (br0) and guest (br1) traffic can now traverse my 802.1q trunk (logical switch port 4, physical port 1) to my second R7800 (that has the same VLAN config on logical port 4).

///r7800-2\\\
### Configure logical switch port 4 (physical port 1) as an 802.1q VLAN tagged port for VLANs 1 (internal) and 11 (guest).  Also move the yellow Internet (WAN) port 5 to VLAN 11 (so I can use it as a wired guest port instead of a WAN/Internet port)). ###
# Enable VLANs
swconfig dev switch0 set enable_vlan 1
# Change default LAN VLAN 1 to be tagged on logical switch port 4 (physical port 1).  By default it's set to "1 2 3 4 6".
swconfig dev switch0 vlan 1 set ports "1 2 3 4t 6"
# Remove default WAN VLAN 2 from the yellow Internet (WAN) port 5 (by default it's set to "0 5")
swconfig dev switch0 vlan 2 set ports "0"
# Add new VLAN 11 to be tagged on logical switch port 4 (physical port 1) and untagged on (WAN) port 5
swconfig dev switch0 vlan 11 set ports "4t 5 6t"
# Activate the new switch configuration
swconfig dev switch0 set apply
## At this point the layer2 configuration is done, logical port 4 is now an 802.1q vlan tagged port and the yellow Internet (WAN) port (5) is now assigned to the new guest VLAN 11
## Below we map this layer2 guest VLAN (11) to the layer3 guest network (configured on br1)
# Create vlan device 11 on interface eth1 (aka eth1.11) for the new VLAN 11
vconfig add eth1 11
# Map eth1.11 to my preexisting guest bridge br1
# Note I also add eth1.11 to br1 in the "Setup->Networking" page's "Assign to Bridge" section.  If you don't add it on this web page then clicking "Apply Settings" on some pages (like "Setup->Networking" and "Administration->Management") will cause this "eth1.11 to br1" mapping to be lost.  This 'brctl addif br1 eth1.11' startup command is also needed so that eth1.11 is assigned to br1 on start up.
brctl addif br1 eth1.11
# Activate network interface eth1.11
ifconfig eth1.11 up
# VLAN configuration is done.  At this point internal (br0) and guest (br1) traffic can now traverse my 802.1q tagged port (logical switch port 4, physical port 1) to my other R7800 (that has the same VLAN config on logical port 4).  Any computer I plug into the the yellow Internet port (5) is placed in my guest VLAN 11.
Sponsor
mrjcd
DD-WRT Guru


Joined: 31 Jan 2015
Posts: 6290
Location: Texas

PostPosted: Mon Jul 19, 2021 2:38    Post subject: Re: Apply Settings can make vlan bridge assignments disappea Reply with quote
seems 'bout same as I discovered years back Razz

from EA8500 VLAN page https://mrjcd.com/EA8500_DD-WRT/vlans/
mrjcd wrote:
"Why does it seem like we are doing the same thing twice in startup commands and in the GUI?" AFAICT this is what I consider race conditions about what & when certain items are created ... Lets just say you cannot set parameters on some things that are not yet there...... I would likely get most of it wrong trying to explain further.
jimj
DD-WRT Novice


Joined: 18 Oct 2015
Posts: 35
Location: Sioux Falls SD

PostPosted: Mon Jul 19, 2021 3:53    Post subject: Re: Apply Settings can make vlan bridge assignments disappea Reply with quote
mrjcd wrote:
seems 'bout same as I discovered years back Razz


I figured I wasn't the first to notice this. It's an annoying little feature of the interaction between the GUI and startup commands. If you're not aware of this it makes it seem like your VLAN bridge mapping is disappearing randomly. I assume the real fix for this is to allow all of the VLAN (and bridge) configuration to be done via the GUI, but that's probably a major code change that won't happen anytime soon.

Nice tutorial web page, wish I had seen that when I was learning DD-WRT vlan configuration.

_________________
R7800 v3.0-r47086 std (07/22/21)
set "tcp_tw_recycle" to 0
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6440
Location: UK, London, just across the river..

PostPosted: Mon Jul 19, 2021 5:33    Post subject: Reply with quote
hehe GUI Vlan's / Bridges tend to do that, but if you wait a proper amount of time or reboot, on some builds they reappear...

Although GUI is working, its best to use start up commands instead...!

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
jimj
DD-WRT Novice


Joined: 18 Oct 2015
Posts: 35
Location: Sioux Falls SD

PostPosted: Mon Jul 19, 2021 23:52    Post subject: Reply with quote
Alozaros wrote:
hehe GUI Vlan's / Bridges tend to do that, but if you wait a proper amount of time or reboot, on some builds they reappear...

Although GUI is working, its best to use start up commands instead...!


When I only use startup commands the bridge table mapping is lost when you Apply Settings on some pages.

_________________
R7800 v3.0-r47086 std (07/22/21)
set "tcp_tw_recycle" to 0
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14223
Location: Texas, USA

PostPosted: Mon Jul 19, 2021 23:56    Post subject: Reply with quote
"Save" .... and then go to "Services" or "Administration" and click "Reboot Router".
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum