Posted: Wed Feb 01, 2023 16:56 Post subject: How to delete a vlan, R7800/r51530
I added a new vlan via putty. I then decided to start over but when I entered nvram erase && reboot the newly configured vlan settings remained. So I wrote the original settings to nvram and these were saved, but after a subsequent nvram erase && reboot, so was the new vlan I had configured earlier. I haven't been able to find a way to delete vlan2ports=2 5 from nvram. Can you please advise how? Thanks!
Atheros uses swconfig; It does not necessarily use the nvram variables. Having no idea what you did via PuTTY, you could do nvram set vlan2ports=(whatever the correct defaults are, may be 0 and 5?) && nvram commit to rectify that situation if indeed there is something broken. _________________ "The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost
"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio
Joined: 08 May 2018 Posts: 14221 Location: Texas, USA
Posted: Thu Feb 02, 2023 19:10 Post subject:
VLAN 0 is invalid. Atheros does not use those variables, unless the webUI shows wrong output on the Switch Config page, and I would have to check code and verify. Long-standing known information. _________________ "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
Joined: 16 Nov 2015 Posts: 6437 Location: UK, London, just across the river..
Posted: Thu Feb 02, 2023 22:41 Post subject:
matjazk wrote:
@Ontarier
So if you do
nvram unset vlan2ports
nvram commit
and then reboot, what happens?
as you can see nvram show | grep vlan.ports
vlan1ports=0 5
vlan0ports=1 2 3 4 5*
nvram unset vlan2ports will not do much as its not existing...
as well as dale_gribble39 said from above... "Atheros uses swconfig; (correct, even Broadcom on the recent builds is using it too)... It does not necessarily use the nvram variables" so those are not in use and not matter to the config...as i can also confirm my R7800 is working as expected...so on reset all gets back to default...no problem here...
what matters is the output of swconfig dev switch0 show and you set vlans with swconfig command...either on Atheros, Broadcom and i believe Marvell too... _________________ 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
Joined: 08 May 2018 Posts: 14221 Location: Texas, USA
Posted: Fri Feb 03, 2023 2:44 Post subject:
Alozaros wrote:
matjazk wrote:
@Ontarier
So if you do
nvram unset vlan2ports
nvram commit
and then reboot, what happens?
nvram unset vlan2ports will not do much as its not existing...
TheOP was looking for a way to remove the variable that was set via nvram set. The best way is nvram unset as nvram clear or nvram erase may not remove it, as noted in the OP.
Ontarier wrote:
...I haven't been able to find a way to delete vlan2ports=2 5 from nvram...
@matjazk: Thanks! You have put my mind at ease with regard to my possibly having made harmful changes/ones I wouldn’t be able to undo. Before seeing your reply I had tried the “swconfig dev switch0 show” after seeing it on another thread and got the same output as you. But not having noticed the swconfig requirement previously, I recorded the original config and made the my changes to it using nvram commands. Now when I enter “nvram show | grep vlan.*ports | sort” I get:
vlan0ports=1 2 3 4 5*
vlan1ports=1 2 3 5*
(I had created a “new” vlan 2 thinking 0 and 1 were the exiting vlans, then was able to erase the digit 2, but didn’t know how to erase the “vlan2ports” part. But I do now, thanks to your “nvram unset vlan2ports nvram commit” suggestion. U da dd-wrt user!)
So, is this nvram vlan0 etc. output meaningless, and I should just forget about it? Is it safe to delete vlan0ports=1 2 3 4 5* and vlan1ports=1 2 3 5* using your suggestion for deleting the vlan2ports= script? Can I edit the GUI to show that the router has VLANS 1 and 2 and not 0 and 1? And why is it that when I reset to defaults the changes I made using nvram commands don’t disappear?
Much appreciated matjazk, dale_gribble39, kernel-panic69 and Alozaros!
That's the build I'm using. The GUI, though, has vlan0 and vlan1, with ports 1-4 in vlan0 and only the WAN port checked in vlan1. vlan2 is listed as well but with no ports. My impression is that the GUI doesn't correspond with the saved settings on the r7800.
Joined: 21 Aug 2019 Posts: 120 Location: Here, There And Everywhere
Posted: Fri Feb 03, 2023 23:10 Post subject:
It has been said in many threads that for VLANs on Atheros one shouldn't use the Web UI, but only command line tools (swconfig). I once forgot this and managed to lock up the router completely (hard reset was necessary to revive it).
I had mentioned noticing something similar in another thread. However, as indicated to me, nvram variables/configuration should only be used with Broadcom devices.
Note that configuring the nvram variables DOES result in the GUI "Switch Config" page to correctly display the configured nvram settings. However, this doesn't mean it's actually working as configured!
The basic takeaway was that the "Switch Config" GUI page should be avoided on Atheros devices and that it was in need of a major overhaul.
For Atheros devices, only the swconfig tool should be used to configure VLANs/ports. Once you've established a set of configuration commands that work for your needs, add those to the startup commands. The "Switch Config" GUI page WON'T reflect the configuration, so just ignore it and don't tamper with it.
Well thanks to you I have both the nvram and swconfig vlan settings back to what they should be. Now I just have to find a tutorial showing how to configure vlans using swconfig. I saw mention of an r7800 vlan tutorial by ecg but haven't found it yet. I really appreciate your input.