Is there an open ticket on this? I don't generally suggest it, but if there ain't one open...
I opened a ticket about the switch problem last summer. It was never resolved. I am continuing to look into the problem, because I need to make AP/switches. The series of commands you quote above works for awhile but then suddenly stops working.
In my research, I discovered that much of the documentation regarding the use of VLANs within DD-WRT dates from the time when it only supported Broadcom chipsets, and doesn't explain what's going on in routers that use Atheros chipsets. (The best information I have found is at https://wiki.dd-wrt.com/wiki/index.php/TP-Link_TL-WDR4300, which describes a TP-Link Atheros-based router.) From what I can tell, the Atheros architecture is different: eth1 (the WAN port) is a separate hardware port and does not run through the switch as it does on Broadcom chipsets. eth0, which is part of the bridge br0, does run through the switch, which on Atheros isn't configured by default to do VLANs.
When you type the command "swconfig dev switch0 show" or "swconfig dev eth0 show" in the shell, you get
Which suggests that just enabling a VLAN 1 should not do much by itself. Everything will still just be part of the same untagged "VLAN 0" (the null VLAN) unless joined to the new VLAN. For some reason, creating an empty VLAN 1 (using the commands you quoted above) did let the switch pass packets between ports for awhile, but that didn't persist.
My next step was to try not only creating a VLAN 1 but also moving all ports onto it (all untagged). But that did not work; the router just became unresponsive until the next reboot. I don't want to enable "mirroring," because that would effectively turn the ports into a hub rather than a switch, with EVERY packet being echoed through every port. So, I'm not sure what to try next. Ideas?
Last edited by Brett Glass on Fri Mar 20, 2020 4:54; edited 4 times in total
Joined: 08 May 2018 Posts: 14246 Location: Texas, USA
Posted: Fri Mar 20, 2020 3:42 Post subject:
I'm not sure if this will give you any ideas on what to try, but what the hell:
Code:
You must use swconfig commands in startup.
Here is an example:
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports "3 4t 6"
swconfig dev switch0 vlan 3 set ports "1 2 4t 6t"
swconfig dev switch0 set apply
vconfig add eth1 3
ifconfig eth1.3 192.168.1.1 netmask 255.255.255.0
To see the current config: swconfig dev switch0 show
swconfig -h for help.
You may have to set the ports to the vlan, perhaps? I'm pretty sure that is a Per Yngve Berg quote. The other thing is, I thought there was supposed to be a vlan0 and vlan1 or vlan1 and vlan2, generally speaking, regardless of platform (Broadcom, Atheros, Marvell, Ralink, etc.) ?? _________________ "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
I'm not sure if this will give you any ideas on what to try, but what the hell:
Code:
You must use swconfig commands in startup.
Here is an example:
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports "3 4t 6"
swconfig dev switch0 vlan 3 set ports "1 2 4t 6t"
swconfig dev switch0 set apply
vconfig add eth1 3
ifconfig eth1.3 192.168.1.1 netmask 255.255.255.0
To see the current config: swconfig dev switch0 show
swconfig -h for help.
Yep, I know about those commands. Could not find anything that helped. (BTW, you can use the swconfig command anytime - not just at startup. There's just rarely a reason to.)
Quote:
You may have to set the ports to the vlan, perhaps? I'm pretty sure that is a Per Yngve Berg quote.
The ports ARE set to a VLAN. It's just VLAN 0; the "null" VLAN. This is because there are no trunks in the default configuration; no need for tagged packets anywhere.
Quote:
The other thing is, I thought there was supposed to be a vlan0 and vlan1 or vlan1 and vlan2, generally speaking, regardless of platform (Broadcom, Atheros, Marvell, Ralink, etc.) ??
No need for multiple VLANs in the default configuration if you have a separate hardware WAN port (which the Atheros chips do). See the output from the swconfig command in my earlier post.
Joined: 08 May 2018 Posts: 14246 Location: Texas, USA
Posted: Fri Mar 20, 2020 5:03 Post subject:
Well, all I can say is that all I have ever had to do is
Code:
swconfig dev switch0 set reset 1
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 set apply
and nothing else that I recall on any of the TP-Links that have this issue that I've flashed DD to and set up as APs. Was the webUI ever fixed for this, I have no idea. _________________ "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
I wish that worked! Put it in the startup script and it worked for a few minutes and then stopped. Wish I knew what daemon might be disabling the switch again. Or why just enabling a new VLAN (which is what the second command does) makes a bit of difference on ANY router!
Joined: 08 May 2018 Posts: 14246 Location: Texas, USA
Posted: Fri Mar 20, 2020 15:45 Post subject:
Try without the reset command, and issue the other 4?
Code:
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 set apply
swconfig dev eth0 set enable_vlan 1
swconfig dev eth0 set apply
Outside of that, perhaps setting the ports, checking brctrl, etc in the referenced wiki for the WDR4300... I'm kinda grasping, here. What was the last build you tried? I generally don't mess with devices that are strictly AP/switch that are behind upstream routers and firewalls, and I know all the ones I have out there have older-ish builds. _________________ "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: 6447 Location: UK, London, just across the river..
Posted: Fri Mar 20, 2020 17:59 Post subject:
as kernel-panic69 said on WAP/Switch devices last are not very important so if you find and old build that works for you..stick to it...
I do have 740 v4 and v1 bot working with those build in my signature, but i cannot confirm their switch LAN ports as I do not used them... In the past i used
those 2 commands to make them work but that was an ages ago...
swconfig dev eth1 set enable_vlan 1
swconfig dev eth1 set apply
Also swconfig is very limited on those devices no VLAN support as those have only 4MB flash size...
I cant test anything on those devices as im away of them...
But i ll do once im back and will report... _________________ 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
P.S. - Apparently, this behavior is a known problem in OpenWRT as well as in DD-WRT (which seems to have borrowed the swconfig utility and driver from it). See, for example,
I'm now convinced that the swconfig utility simply lacks a command to set the switch up properly. The driver may also need to be updated.
What we DO know is that the stock firmware and Mikrotik both get it right and are able to make the switch chip work properly, enabling learning and reliable forwarding, so IT CAN BE DONE if the developers want to tackle it. It might not even be particularly hard, since the switch is mostly working correctly already. A peek at the Mikrotik implementation might help; they give a very detailed technical description at
Joined: 08 May 2018 Posts: 14246 Location: Texas, USA
Posted: Sat Mar 21, 2020 2:49 Post subject:
Well, that made for some interesting reading. I have a bricked TL-WR1043ND on the way from another forum member (in Taiwan!) whenever they get around to dropping it at the post office that I'm going to be trying to revive, so I may get a chance to muck around with this to see what works. There's been so many ongoing Atheros driver and firmware commits, there ain't no telling what broke, though. My takeaway so far focuses around this bit:
swconfig dev eth0 set reset
swconfig dev eth0 set enable_vlan 1
swconfig dev eth0 vlan 1 set ports "0 1 2 3 4 5"
swconfig dev eth0 set apply
EDIT: I am looking at the 3.10 and 3.18 kernel trees, are these the kernels used in these devices? If so, I may have found something that didn't get merged when moving from 3.2/3.3....
EDIT 2: I found an open ticket related to this for 3.18 kernel on TL-WR940Nv3 / TL-WR941Nv6 and submitted my findings. Crossing fingers. Looks like one typo was fixed in 36339https://svn.dd-wrt.com/changeset/36339/ , but it is and isn't related to the overall issue with vlans and the workarounds that have been being used.
swconfig dev eth0 set reset
swconfig dev eth0 set enable_vlan 1
swconfig dev eth0 vlan 1 set ports "0 1 2 3 4 5"
swconfig dev eth0 set apply
Wait a minute. Is the boldfaced line included somewhere in the DD-WRT firmware? Is it being executed every so often? If so, it would explain why the switch initially passes packets as it should and then quits. Why? Because the switch only has four external ports, plus the internal "virtual" port for the CPU, numbered from 0 to 4. There is no port 5! So, that command would fail, leaving the switch unconfigured. The command should be
Joined: 08 May 2018 Posts: 14246 Location: Texas, USA
Posted: Sun Mar 22, 2020 19:36 Post subject:
Dependent on device and architecture, the CPU is either 5 or 8, if I am not mistaken (at least on Broadcom, anyway). The rest represent all the ethernet ports and such. That was taken from the OpenWRT discussion in the ticket I referenced with my suggestions to fix the issue in DD, I think? Dang, been waiting for you to respond so long, I forgot haha. If in fact the 5 is invalid to use, then that might help fix the issue for a workaround until this gets sorted. _________________ "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
Dependent on device and architecture, the CPU is either 5 or 8, if I am not mistaken (at least on Broadcom, anyway).
Nope. This is Atheros. On Atheros, the WAN port is not part of the internal switch, so there are only 5 ports on the switch, numbered 0 through 4. The output of the swconfig command makes this clear. If there's an internal script that assumes there is a port 5, it needs to be fixed because it is probably the source of the problem.