What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Setting VLANs in nvram

orion2

New Around Here
Hello, I'm having some frustration with setting the default vlan port assignments in nvram.

I have an AC87U running the latest stable build of Merlin (378.50)
The unit is set in AP mode, 1 guest wifi, jffs (and jffs scripts) enabled, ssh enabled etc.

The goal is to have port 0 (which is the "WAN" port) set to not be assigned to vlan1, without relying on a script to do so. I don't care if the port is even set to any vlan by default, just so long as it is not on vlan1. The scripts in jffs can do the rest but I want something more reliable than the jffs scripts for this part of the configuration.

Unfortunately when I try to set that up and reboot my settings are lost. commands used:
nvram set vlan1ports="1 2 3 4 7*"
nvram set vlan2ports="0 7"
nvram commit
reboot

I have tried with and without setting port0 to be part of vlan2.
the only difference between what I set and default is what vlan port 0 is assigned to. Checking nvram after the commit shows that the setting was changed. After a reboot, the vlans come back as default however.

I did try to search on these forms but did not run across anything useful. I'm aware that just using scripts is going to work 99% of the time, but I need to get to 99.9% of the time as this will be going in a small office and I don't want to have to "babysit" the device :)
 
And I have similar problems. I bought a router Asus RT-AC56U and have trouble with iptv. My provider is broadcasting iptv in a separate VLAN VID6, if the tab LAN IPTV choose Manual, set ports 3 and 4 VID6, then only one of the two IPTV set-top boxes Motorolla starts, and the second says that he can not obtain an IP address. Tried through telnet:
nvram set vlan6ports = '2 3 4t 5'
nvram set vlan6hwname = 'et0'
nvram set vlan1ports = '0 1 5 *'
nvram commit
reboot
then both IPTV boxes are starting to show but lost the internet.
After the command "nvram show | grep vlan" outputs vlan1ports=0 1 2 3 5* even though the" 2 3 "I appointed vlan6. After changes to nvram get that ports 0 and 1 have vlan1 and vlan6, and apparently so no internet, and both consoles fine show. I've tried different versions of Merlin firmware and also Tomato.
Sorry for my english.
Help please.
 
Last edited:
After the command "nvram show | grep vlan" outputs vlan1ports=0 1 2 3 5* even though the" 2 3 "I appointed vlan6.
Maybe "nvram set" command not work because I have 1.0.2.3 bottloader and this command does not change what writed in bootloader???
 
I downgrade boot loader to 1.0.1.9 us, no changes, after router reboot vlan1ports=0 1 2 3 5*
 
Ok, so I verified I can set a new value in NVRAM and it will persist through a reboot

nvram set test=hello
nvram commit
reboot
(wait, log back in to ssh)
nvram show | grep test

I've also set the ssid of one of the unused guest wifi, and that sticks as well. Seems like something is changing the vlan settings
 
Yes i can set: nvram set vlan6ports = '2 3 4t 5'
nvram set vlan6hwname = 'et0'
and it will persist through a reboot, but when i change vlan1 ports after reboot it back to default. I don't understand, maybe need try DD-WRT firmware.
 
I can't find any stable firmware for the AC87U, you might have better luck with your router :)

I wonder if there is a way to turn on more logging to see if something is changing the vlan1 setting
 
Search the forum... vlan1 reset

Member AndreyPopov stated:

"to configure ports and vlans use /jffs/init-start with robocfg command"
 
Folks, the only way to change the vlan settings is using a script that runs after initialization. The nvram variables are set/reset to a default configuration during the initialization depending on if you are using a single or dual WAN configuration.
 
Folks, the only way to change the vlan settings is using a script that runs after initialization. The nvram variables are set/reset to a default configuration during the initialization depending on if you are using a single or dual WAN configuration.

Any way to change that? Relying on a script for that could lead to the device bridging 2 networks should the script fail or fail to run.

My other thought is running the router in the default mode. It would mean more things to configure from scripts, but it reduces the chance of what would be unacceptable behavior from the device.

Further, it makes 0 sense for the firmware to do what you are stating when it is set as AP only mode. It seems like a bug for it to do so in AP mode, are you sure that is correct behavior?
 
Last edited:
Search the forum... vlan1 reset

Member AndreyPopov stated:

"to configure ports and vlans use /jffs/init-start with robocfg command"
Amusingly, doing that exact search doesn't find the post your quote comes from, I had to search for the quote itself. Searching for "vlan1 reset nvram" didn't show any threads that seemed relevant either.
 
And I have similar problems. I bought a router Asus RT-AC56U and have trouble with iptv. My provider is broadcasting iptv in a separate VLAN VID6, if the tab LAN IPTV choose Manual, set ports 3 and 4 VID6, then only one of the two IPTV set-top boxes Motorolla starts, and the second says that he can not obtain an IP address. Tried through telnet:
nvram set vlan6ports = '2 3 4t 5'
nvram set vlan6hwname = 'et0'
nvram set vlan1ports = '0 1 5 *'
nvram commit
reboot
then both IPTV boxes are starting to show but lost the internet.
After the command "nvram show | grep vlan" outputs vlan1ports=0 1 2 3 5* even though the" 2 3 "I appointed vlan6. After changes to nvram get that ports 0 and 1 have vlan1 and vlan6, and apparently so no internet, and both consoles fine show. I've tried different versions of Merlin firmware and also Tomato.
Sorry for my english.
Help please.
Hi. I have rt ac56u too. My isp TEO broadcast iptv on vlan 6 aswell. I use this nvram configuration and everything is good.
Code:
 nvram set 'vlan10ports=4 5u'

nvram set 'vlan10hwname=et0'

nvram set 'vlan6ports=2 3 4t 5'

nvram set 'vlan6hwname=et0'

nvram unset 'vlan2ports'

nvram unset 'vlan2hwname'

nvram set 'vlan1ports= 0 1 5*'

nvram commit

reboot
Don't worry about vlan10. That one is not tagged so it doesnt matter
 
And I have similar problems. I bought a router Asus RT-AC56U and have trouble with iptv. My provider is broadcasting iptv in a separate VLAN VID6, if the tab LAN IPTV choose Manual, set ports 3 and 4 VID6, then only one of the two IPTV set-top boxes Motorolla starts, and the second says that he can not obtain an IP address. Tried through telnet:
nvram set vlan6ports = '2 3 4t 5'
nvram set vlan6hwname = 'et0'
nvram set vlan1ports = '0 1 5 *'
nvram commit
reboot
then both IPTV boxes are starting to show but lost the internet.
After the command "nvram show | grep vlan" outputs vlan1ports=0 1 2 3 5* even though the" 2 3 "I appointed vlan6. After changes to nvram get that ports 0 and 1 have vlan1 and vlan6, and apparently so no internet, and both consoles fine show. I've tried different versions of Merlin firmware and also Tomato.
Sorry for my english.
Help please.

Hi. I have rt ac56u too. My isp TEO broadcast iptv on vlan 6 aswell. I use this nvram configuration and everything is good.
Code:
 nvram set 'vlan10ports=4 5u'

nvram set 'vlan10hwname=et0'

nvram set 'vlan6ports=2 3 4t 5'

nvram set 'vlan6hwname=et0'

nvram unset 'vlan2ports'

nvram unset 'vlan2hwname'

nvram set 'vlan1ports= 0 1 5*'

nvram commit

reboot
Don't worry about vlan10. That one is not tagged so it doesnt matter
You are sure to have AC56U, maybe to you RT-N56U? And what version of firmware to you?
 
Last edited:
You are sure to have AC56U, maybe to you RT-N56U? And what version of firmware to you?
Yes, im sure I have AC56U
I'm running latest merlin fork. But these commands worked for me since summer with all firmware versions

You don't have internet because with your setup WAN takes vlan6 which is meant for iptv. Vlan 10 in my setup is meant for WAN to switch from vlan6 to vlan10 or any other(it does't matter because it is untagged. You can use vlan15 it will still work)
Just try my exact setup and it ahould work
 
Last edited:
I understand that when in routing mode that the Vlans need to be forced on startup to enable dual-WAN. However, when running in AP mode it makes no sense to force the Vlan config on every startup
 
Merlin has clearly stated in the past he is not going to be making any changes to the VLAN code from ASUS. The scripting capability allows you to make changes if you need to. I wouldn't expect any code changes.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top