How to delete a vlan, R7800/r51530

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page 1, 2, 3  Next
Author Message
Ontarier
DD-WRT Novice


Joined: 30 May 2015
Posts: 43

PostPosted: Wed Feb 01, 2023 16:56    Post subject: How to delete a vlan, R7800/r51530 Reply with quote
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!
Sponsor
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1933

PostPosted: Wed Feb 01, 2023 18:28    Post subject: Reply with quote
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

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
matjazk
DD-WRT User


Joined: 21 Aug 2019
Posts: 120
Location: Here, There And Everywhere

PostPosted: Thu Feb 02, 2023 18:53    Post subject: Reply with quote
swconfig dev switch0 show on my R7800:

VLAN 1:
vid: 1
ports: 1 2 3 4 6
VLAN 2:
vid: 2
ports: 0 5

Hope it helps.
matjazk
DD-WRT User


Joined: 21 Aug 2019
Posts: 120
Location: Here, There And Everywhere

PostPosted: Thu Feb 02, 2023 18:57    Post subject: Reply with quote
Output of
nvram show | grep vlan.ports

vlan1ports=0 5
vlan0ports=1 2 3 4 5*

So it seems that internally vlans start at 0.
kernel-panic69
DD-WRT Guru


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

PostPosted: Thu Feb 02, 2023 19:10    Post subject: Reply with quote
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
Alozaros
DD-WRT Guru


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

PostPosted: Thu Feb 02, 2023 19:50    Post subject: Reply with quote
same here....

root@dingdong:~# nvram show | grep vlan.ports
size: 51088 bytes (79984 left)
vlan1ports=0 5
vlan0ports=1 2 3 4 5*

so, clearly those are not in use than....

couse i have segmented ports and according to the start up script...
swconfig dev switch0 show shows correct values
and correct segmentation...

VLAN 2:
vid: 2
ports: 0 5
so dale is correct...

_________________
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
matjazk
DD-WRT User


Joined: 21 Aug 2019
Posts: 120
Location: Here, There And Everywhere

PostPosted: Thu Feb 02, 2023 20:21    Post subject: Reply with quote
@Ontarier

So if you do

nvram unset vlan2ports
nvram commit

and then reboot, what happens?
Alozaros
DD-WRT Guru


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

PostPosted: Thu Feb 02, 2023 22:41    Post subject: Reply with quote
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... Wink

_________________
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
kernel-panic69
DD-WRT Guru


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

PostPosted: Fri Feb 03, 2023 2:44    Post subject: Reply with quote
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...

_________________
"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
Ontarier
DD-WRT Novice


Joined: 30 May 2015
Posts: 43

PostPosted: Fri Feb 03, 2023 18:58    Post subject: Reply with quote
@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!
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6867
Location: Romerike, Norway

PostPosted: Fri Feb 03, 2023 20:18    Post subject: Reply with quote
You are using an old build. On newer build, vlans can be added/removed. Your build have 16 fixed vlans in the Switch Config tab in the GUI.

Latest build for R7800:

https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2023/01-29-2023-r51530/netgear-r7800/
Ontarier
DD-WRT Novice


Joined: 30 May 2015
Posts: 43

PostPosted: Fri Feb 03, 2023 21:17    Post subject: Reply with quote
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.
matjazk
DD-WRT User


Joined: 21 Aug 2019
Posts: 120
Location: Here, There And Everywhere

PostPosted: Fri Feb 03, 2023 23:10    Post subject: Reply with quote
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).
sumbuddie
DD-WRT User


Joined: 28 Mar 2009
Posts: 77

PostPosted: Fri Feb 03, 2023 23:13    Post subject: Reply with quote
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.
Ontarier
DD-WRT Novice


Joined: 30 May 2015
Posts: 43

PostPosted: Fri Feb 03, 2023 23:36    Post subject: Reply with quote
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.
Goto page 1, 2, 3  Next Display posts from previous:    Page 1 of 3
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