Posted: Thu Apr 28, 2022 17:07 Post subject: [SOLVED] Setup a tagged VLAN100 via the GUI or swconfig?
Hi,
I need a tagged VLAN 100 in between the 2 boxes of my ISP (in between the modem and the A/V box, through the DD-WRT router, an Asus RT-AC66U, hardware A2).
A simple command was doing the job and it worked fine for the last 4 years...
Code:
echo "0t 4t" > /proc/switch/eth0/vlan/100/ports
For information, the VLAN is created in between the hardware LAN port #4 (internal port #0 - because of the reverse numbering) and the WAN (internal port #4).
When I upgraded DD-WRT in Oct. 2020, everything was still working fine.
But I upgraded again DD-WRT today, the VLAN stopped working
After some investigation, I saw that if I manually run the command I get this answer:
Quote:
sh: eval: line 0: can't create /proc/switch/eth0/vlan/100/ports: nonexistent directory
But the problem could be that VLAN2 is also tagged and your ISP router cannot deal with that (which makes sense in this case)
So this must to be done manually with swconfig.
Yep, that's unfortunately also what I think.
The GUI "Tagged" or not setting is not by VLAN. It looks like for all VLANs or none.
So I still hope we can do it via the GUI, but I'm afraid I may have to go via swconfig (which is not necessarily heavy to setup, but it's always easier when everything can be done via the GUI).
Thanks anyway egc. I appreciate your help as always!
I also hope someone else will be able to help. The family IPTV is not working since the upgrade and I don't want to go back to the 44467. I already fixed all the issues related to the upgrade of OpenVPN, re-setup server and clients, so I don't want to spend time breaking everything.
Maybe something like that with swconfig?
I tried 2 configs based on answers in other threads but with no luck so far...
Code:
swconfig dev eth0 set enable_vlan 1
swconfig dev eth0 vlan 100 set ports "0t 4t"
swconfig dev eth0 set apply
vconfig add eth0 100
ifconfig vlan100 up
Code:
swconfig dev eth0 set enable_vlan 1
swconfig dev eth0 vlan 100 set ports "0t 4t"
swconfig dev eth0 set apply
vconfig add eth0 100
ifconfig eth0.100 192.168.0.1 netmask 255.255.255.0
Last edited by FTP on Fri Apr 29, 2022 9:38; edited 1 time in total
Joined: 18 Mar 2014 Posts: 12887 Location: Netherlands
Posted: Fri Apr 29, 2022 9:31 Post subject:
FTP wrote:
Maybe something like that with swconfig?
Code:
swconfig dev eth0 set enable_vlan 1
swconfig dev eth0 vlan 100 set ports "0t 4t"
swconfig dev eth0 set apply
vconfig add eth0 100
ifconfig vlan100 up
For me it is also a bit of a guessing game as I knew how to do it with nvram (the old way) but not yet with swconfig.
As you already have made VLAN 100 in the GUI i would guess you only need to tag the WAN port and not make the interface etc.
swconfig list
will show how the switch is called usually switch0 but for you it might be different
You start with enabling swconfig:
swconfig dev switch0 set enable_vlan 1
Then tag port 0 (port 4 is already tagged but perhaps you should do it too?)
swconfig dev switch0 vlan 100 set ports "0t 5t"
Apply
swconfig dev switch0 set apply
If it works you have to place it in startup
Edit: usually you have to include the CPU port so if port 4 was not already tagged you do:
swconfig dev switch0 vlan 100 set ports "0t 4t 5t"
swconfig list
will show how the switch is called usually switch0 but for you it might be different
Yep, switch0 ...
Quote:
Found: switch0 - bcm53125
But the following commands...
Code:
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 100 set ports "0t 4t"
swconfig dev switch0 set apply
...gave the message...
Quote:
swconfig list
swconfig dev [port |vlan ] (help|set |get |load |show)
I've also added again the VLAN100 line in the GUI + try to run the following commands, but with no success...
Code:
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 100 set ports "0t 4t"
swconfig dev switch0 set apply
Code:
swconfig dev eth0 set enable_vlan 1
swconfig dev eth0 vlan 100 set ports "0t 4t"
swconfig dev eth0 set apply
I also tried removing the VLAN100 line in the GUI and run the following commands woth "switch0" instead of "eth0" with still no luck...
Code:
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 100 set ports "0t 4t"
swconfig dev switch0 set apply
vconfig add switch0 100
ifconfig vlan100 up
So port 0 and 4 are tagged for ALL VLANs and that's where I loose Internet access on the LAN and WiFi.
So mixing GUI and swconfig settings "may" not be easy as there's no way I can setup a VLAN100 in the GUI without tagging some ports of VLAN1 or VLAN2, or removing them from VLAN1 or VLAN2.
Indeed, if I add a VLAN100 without selecting any port, the line is saved but the VLAN100 is not created (according to "swconfig dev switch0 show").
And if I want to select at least one port for the VLAN100, I need to tick "tagged" and either it will tag the ports on VLAN1 or VLAN2, or... I will have to remove some ports from VLAN1 or VLAN2.
So it may be best to do everything with swconfig, leave VLAN1 & VLAN2 as is and just add the appropriate VLAN100 with swconfig
Yep, that's what I understand too.
Also, obviously swconfig works differently than the previous command using the directories.
With "echo "0t 4t" > /proc/switch/eth0/vlan/100/ports", 4 was the WAN port, 0 to 3 the LAN port in reverse numbering, it has been tested and confirmed by me and several persons, even on the forums. The association with the CPU (port 8 ) was also maybe done silently, like with the GUI, I don't know.
But with swconfig, obviously port 0 is the WAN (like on the GUI), 1 to 4 the LAN ports in the right order and 8 the CPU.
And we "may" have to associate ourself in the command the port 8 tagged when we create a VLAN. TBC.
Now, even knowing all that, I still have a problem.
I can't create the VLAN100 via the GUI for the reasons seen above and so far, I've not been able yet to create a single VLAN via the swconfig commands.
When I just use the first 3 lines...
Code:
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 100 set ports "0t 4t 8t"
swconfig dev switch0 set apply
...I get this message and nothing is created:
Quote:
swconfig list
swconfig dev [port |vlan ] (help|set |get |load |show)
And when I use the 5 lines (with vconfig and ifconfig), I don't have any message, but still, no VLAN is created:
Code:
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 100 set ports "0t 4t 8t"
swconfig dev switch0 set apply
vconfig add eth0 100
ifconfig vlan100 up
And I tried several variant according to what I found in other threads like:
So I thought, ok, I'll then have to run those commands via a script and not the NVRAM startup commands
BUT... I got tricked in fact.
It also worked via the NVRAM startup commands!
1/ in fact the message I got was not blocking the VLAN creation process and 2/ I also got tricked as it looks like the VLAN creation was not immediate. There was a little delay in between the command and the availability on the network, so I thought it was not working while after maybe 20/30s it was staring to work fine.
I now have rebooted the router 3 or 4 times and it's always the same behaviour, the VLAN100 is always created and available maybe 20/30s after the availability of Internet on the LAN. But at the end it works fine.
Now the last question I have is: are the last 2 lines really useless, as Per Yngve Berg always advised to add them...