Posted: Wed Nov 03, 2021 10:37 Post subject: [SOLVED]Help needed with VLAN Tagging for PPPoE
I’ve read numerous posts in the forum and did not stumble upon solution that solves my pppoe issue so I hope that one of you compassionate souls out there will have time to help me out. I have read the Switched Ports wiki page again and again and I am still not sure whether I have tried the proper combination of nvram / swconfig settings.
I have used DD WRT for at least 10 years now and have since only purchased routers which can be flashed with DD WRT. Flashing is typically the first thing I do after the unboxing. Thank you all!
Last week I switched to a new fiber connection, and I am now trying to set up the above mentioned router to connect to the ISP’s Fiber Optic Modem. The ISP requires PPPoE connection with authentication and VLAN tag 101.
Factory Netgear firmware works and connection comes up in less than 30 secs after boot up. This confirms that the credentials and VLAN tag which I have obtained from the ISP are correct.
I have tried various combinations of settings with swconfig (r47581), nvram (r4644) and GUI / GUI + nvram and could not get any of them to get WAN IPv4 address. Below are some examples using either port 5 or port 8 as CPU port – I have tried both on all the tested DD WRT releases due to reasons explained further below. Each combination was tested on fresh nvram settings (erase nvram && reboot, wait for proper boot-up, followed by powering off / on the router).
Test Setup 1: SWCONFIG Settings (tried only on r47581):
Code:
# swconfig dev switch0 vlan 2 set vid 101 # Returns error
swconfig dev eth0 vlan 2 set ports '4t 8t'
swconfig dev eth0 vlan 1 set ports '0 1 2 3 5 7 8t'
swconfig dev eth0 set apply
vconfig add eth0 101
ifconfig vlan101 up
ifconfig vlan2 down
Output:
Code:
Unknown attribute "vid"
As I understand, I cannot set the tag on VLANs due to "set vid" attribute missing in swconfig for the Broadcom FW, so I gave this one up hoping that there will be a fix for it in forthcoming firmware releases.
Test Setup 2: NVRAM Settings (tried only on r46446):
Execute script and set it up as Startup script:
Code:
echo "" > /proc/switch/eth0/vlan/1/ports
echo "" > /proc/switch/eth0/vlan/2/ports
echo "3 2 1 0 5t*" > /proc/switch/eth0/vlan/1/ports
echo "4t 5t" > /proc/switch/eth0/vlan/101/ports
ifconfig vlan2 down
vconfig add eth0 101
ip link set dev vlan101 address "AA:BB:CC:DD:EE:FF"
vconfig rem vlan2
ifconfig vlan101 up
ifconfig vlan101 txqueuelen 0
NVRAM config:
Code:
nvram set vlan1ports="3 2 1 0 5*"
nvram set vlan101ports="4t 5"
nvram set port0vlans="1 18 19 21"
nvram set port1vlans="1 18 19 21"
nvram set port2vlans="1 18 19 21"
nvram set port3vlans="1 18 19 21"
nvram set port4vlans="101 16 18 19 21"
nvram set port5vlans="1 101 16"
# nvram unset vlan2hwname
nvram set vlan1hwname=et0
nvram set vlan101hwname=et0
nvram set vlan2hwname=et0
nvram set pppoe_wan_ifname=vlan101
nvram set pppoe_ifname=vlan101
nvram set wan_ifname2=vlan101
nvram set wan_default=vlan101
nvram set wan_ifnames=vlan101
nvram set wan_ifname=vlan101
nvram set wan_iface=vlan101
nvram set vlan101_ipaddr=0.0.0.0
nvram set vlan101_multicast=0
nvram set vlan101_label=
nvram set vlan101_dns_ipaddr=0.0.0.0
nvram set vlan101_dns_redirect=0
nvram set vlan101_mtu=1500
nvram set vlan101_isolation=0
nvram set vlan101_nat=1
nvram set vlan101_bridged=1
nvram set vlan101_hwaddr=AA:BB:CC:DD:EE:FF
nvram set vlan101_netmask=0.0.0.0
nvram set vlan101_txq=0
nvram commit
echo "" > /proc/switch/eth0/vlan/1/ports
echo "" > /proc/switch/eth0/vlan/2/ports
echo "3 2 1 0 5t*" > /proc/switch/eth0/vlan/1/ports
echo "4t 5t" > /proc/switch/eth0/vlan/101/ports
ifconfig vlan2 down
vconfig add eth0 101
ip link set dev vlan101 address "AA:BB:CC:DD:EE:FF"
# vconfig rem vlan2
ifconfig vlan101 up
ifconfig vlan101 txqueuelen 0
reboot
I have observed that the router for some reason reverts to “erase nvram” settings if I try to remove vlan2.
Test Setup 3: GUI + nvram:
1.Setup PPPoE settings with credentials and ”Connect on demand” option
2. Setup->Networking: Create a VLAN 0 interface with Tag Number 101 set on vlan2
3. Apply settings
4. Port Setup -> Wan Port Assignment -> vlan2.101
5. Port Setup -> Network Configuration -> Unbridge vlan2 and vlan2.101
6. Setup -> Switch Config -> Tag WAN port
7. Apply & Reboot
8. Verify Status -> Wan -> Connect -> Connection Uptime: ”Not available”
9. Input nvram set options:
Code:
nvram set vlan2.101ports="4t 8"
nvram set vlan2.101hwname="et2"
nvram set port0vlans="2.101 16"
nvram set port5vlans="1 2.101 16"
nvram set pppoe_wan_ifname="vlan2.101"
nvram set pppoe_ifname="vlan2.101"
nvram commit
reboot
10. Verify connection state: Status->Wan->Connect
Connection Uptime: starts counting
Login Status: Disconnected
IPv4 Address not obtained
Ifconfig shows that new ”ppp0” network is established, transmitting and dropping TX packets
I have tried various combinations of vlan#ports and port#vlans with CPU port set either to 5 or 8. This is due to following observations after flashing the router with Netgear's factory FW, enabling Telnet and configuring PPPoE.
Netgear’s firmware stock settings are equal to DD WRT stock settings:
Joined: 18 Mar 2014 Posts: 12904 Location: Netherlands
Posted: Wed Nov 03, 2021 10:50 Post subject:
I do not have the documentation handy but you should use swconfig in new builds this:
root@EA6900:~# swconfig list
Found: switch0 - bcm53011
root@EA6900:~# swconfig dev switch0 show
Global attributes:
enable_vlan: 1
ports: 0x01bf
reset_mib: ???
enable_jumbo: 0
allow_vid_4095: 0
The above commands will get you going.
You must use dev switch0 e.g. something like (this is just an example !):
swconfig dev switch0 set reset 1
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 2 set vid 201
swconfig dev switch0 vlan 2 set ports "0 5t"
swconfig dev switch0 set apply
Joined: 16 Nov 2015 Posts: 6445 Location: UK, London, just across the river..
Posted: Wed Nov 03, 2021 12:33 Post subject:
hmm for PPPoE you are missing a line
nvram set pppoe_wan_ifname="vlan101"
here how it looks like>
swconfig dev eth0 vlan 2 set vid 101
swconfig dev eth0 vlan 2 set ports '0t 5t'
swconfig dev eth0 vlan 1 set ports '0t 1 2 3 4 5t'
swconfig dev eth0 set apply
vconfig add eth0 101
ifconfig vlan101 up
nvram set pppoe_wan_ifname="vlan101"
bear in mind example its for a different device, so ports and tagging (t) may vary..check the output of this command first than set it up as it should:
swconfig dev switch0 show _________________ 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
Last edited by Alozaros on Wed Nov 03, 2021 16:50; edited 1 time in total
My issue with swconfig is that I for some reason cannot set any attributes on VLANs by the “set vid” command. I have tried to run the command on r47581 and r47608 with same results: Unknown attribute "vid".
Code:
root@DD-WRT:~# swconfig list
Found: switch0 - bcm53011
root@DD-WRT:~# swconfig dev eth0 vlan 2 set vid 101
Unknown attribute "vid"
root@DD-WRT:~# swconfig dev switch0 vlan 2 set vid 101
Unknown attribute "vid"
root@DD-WRT:~# swconfig dev switch0 vlan 2 show
VLAN 2:
ports: 4 8
root@DD-WRT:~# swconfig dev bcm53011 help
switch0: bcm53011(BCM53012), ports: 9 (cpu @ 5), vlans: 4096
--switch
Attribute 1 (int): enable_vlan (Enable VLAN mode)
Attribute 2 (string): ports (Available Ports (as bitmask))
Attribute 3 (int): reset_mib (Reset MIB counters)
Attribute 4 (int): enable_jumbo (Enable Jumbo Frames)
Attribute 5 (int): allow_vid_4095 (Allow VID 4095)
Attribute 6 (none): apply (Activate changes in the hardware)
Attribute 7 (none): reset (Reset the switch)
--vlan
Attribute 1 (ports): ports (VLAN port mapping)
--port
Attribute 1 (string): mib (Get port's MIB counters)
Attribute 2 (int): disable (Disable Port)
Attribute 3 (int): pvid (Primary VLAN ID)
Attribute 4 (unknown): link (Get/Set port link information)
root@DD-WRT:~# swconfig dev switch0 vlan 2 get ports
4 8
root@DD-WRT:~#
I am getting an XR500 tomorrow and will have the opportunity to check whether I am doing something wrong.
Long story short: I used your input to set up a new XR500 unit and got it working with PPPoE and VLAN Tagging in no time.
R8000: still no luck.
root@DD-WRT:~# swconfig dev eth0 vlan 2 set vid 101
Unknown attribute "vid"
root@DD-WRT:~# swconfig dev eth0 vlan 2 set pvid 101
Unknown attribute "pvid"
root@DD-WRT:~# swconfig dev eth0 vlan 1 set vid 101
Unknown attribute "vid"
root@DD-WRT:~# swconfig dev eth0 vlan 1 set pid 101
Unknown attribute "pid"
root@DD-WRT:~#
I will tinker with it some more this weekend.
I am aware that XR500 is an Atheros unit and that the following should probably go into the corresponding subforum, but I believe that the empirical approach can be applied regardless of the unit’s hardware.
Code:
root@DD-WRT:~# swconfig list
Found: switch0 - gpio-0
# Identify VLANs and VLAN ports
root@DD-WRT:~# swconfig dev switch0 vlan 1 show
VLAN 1:
vid: 1
ports: 1 2 3 4 6
root@DD-WRT:~# swconfig dev switch0 vlan 2 show
VLAN 2:
vid: 2
ports: 0 5
# Map physical ports to logical ports and identify CPU ports
root@DD-WRT:~# swconfig dev switch0 show | grep "link:up" | sort # Physical Connection: WAN, LAN 1
link: port:0 link:up speed:1000baseT full-duplex
link: port:4 link:up speed:1000baseT full-duplex auto # Physical LAN 1
link: port:5 link:up speed:1000baseT full-duplex txflow rxflow auto # Physical WAN
link: port:6 link:up speed:1000baseT full-duplex
root@DD-WRT:~# swconfig dev switch0 show | grep "link:up" | sort # Physical Connection: LAN 1
link: port:0 link:up speed:1000baseT full-duplex
link: port:4 link:up speed:1000baseT full-duplex auto # Physical LAN 1
link: port:6 link:up speed:1000baseT full-duplex
root@DD-WRT:~# swconfig dev switch0 show | grep "link:up" | sort # Physical Connection: LAN 2
link: port:0 link:up speed:1000baseT full-duplex
link: port:3 link:up speed:1000baseT full-duplex auto # Physical LAN 2
link: port:6 link:up speed:1000baseT full-duplex
root@DD-WRT:~# swconfig dev switch0 show | grep "link:up" | sort # Physical Connection: LAN 3
link: port:0 link:up speed:1000baseT full-duplex
link: port:2 link:up speed:1000baseT full-duplex auto # Physical LAN 3
link: port:6 link:up speed:1000baseT full-duplex
root@DD-WRT:~# swconfig dev switch0 show | grep "link:up" | sort # Physical Connection: LAN 4
link: port:0 link:up speed:1000baseT full-duplex
link: port:1 link:up speed:1000baseT full-duplex auto # Physical LAN 4
link: port:6 link:up speed:1000baseT full-duplex
...which I believe summarizes to following (sorry, could not find a working tag for the BBCode table):
Run script and set it as a Startup Command through the DD-WRT GUI:
swconfig dev eth0 vlan 2 set vid 101
swconfig dev eth0 vlan 2 set ports '0t 5t'
swconfig dev eth0 vlan 1 set ports '1 2 3 4 6t'
swconfig dev eth0 set apply
vconfig add eth0 101
ifconfig eth0.101 up
Run once script:
nvram set pppoe_wan_ifname="eth0.101"
nvram commit
swconfig settings were not persisted after the Telnet session followed by a reboot, so I had to apply them as a Startup Command through the DD-WRT GUI.
In order to identify the ifconfig interface name (ifconfig [interface name] up), the ”ifconfig -a” command can be run after ”vconfig add eth0 101”.
Joined: 08 May 2018 Posts: 14242 Location: Texas, USA
Posted: Fri Nov 05, 2021 0:44 Post subject:
Probably because Broadcom still uses the webUI, unlike Atheros. I was entertaining the tangent that someone was going to cause just so they would understand that you can't Atheros Broadcom devices. Thank you for verifying that. Now what is in question is just exactly what the solution is for Broadcom and PPPoE.... _________________ "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
Just a short update on the topic. I did not manage to get PPPoE and VLAN tagging to work on R8000, so I’ll be setting this issue aside for the time being even though it really bugs me that the feature works effortlessly with Netgear’s FW. I have no idea whether the issue is related specifically to the R8000, the combination of Broadcom and swconfig or my lack of knowledge and experience.
Like mentioned at the beginning of the post, I feel like I tried every possible combination of webUI and swconfig / nvram (on older releases).
Once again, thanks to everyone who helped me along the way. I feel like I learned a lot during the process.
Joined: 08 May 2018 Posts: 14242 Location: Texas, USA
Posted: Mon Nov 08, 2021 15:50 Post subject:
I don't know if this works on Broadcom or not, but if you tried the VLAN tagging in webUI on the Setup -> Switch Config page and that did not work, did you try VLAN tagging on the Setup -> Networking page? _________________ "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 gave this issue one last try and finally managed to get it working. Thanks once again kernel-panic69, Alozaros and egc.
1: WebUI, Setup
Connection Type: PPPoE
Username & Password from ISP
Save / Apply
2: WebUI, Setup -> Switch Config:
Add VLAN 101
WAN Port: Uncheck VLAN 2, Check VLAN 101, Check Tagged
Port 1: Check VLAN 1, Uncheck Tagged
Port 2: Check VLAN 1, Uncheck Tagged
Port 3: Check VLAN 1, Uncheck Tagged
Port 4: Check VLAN 1, Uncheck Tagged
Port 5: Check VLAN 1, Uncheck Tagged
Save / Apply
3: WebUI, Setup -> Networking:
Port Setup -> WAN Port Assignment: vlan101
Network Configuration vlan101: Unbridged (not necessary for PPPoE connection)
Save / Apply
4: Telnet one time commands:
nvram set pppoe_wan_ifname="vlan101"
nvram commit
reboot
DO NOT TOUCH WebUI->Setup->Networking->VLAN Tagging
Joined: 08 May 2018 Posts: 14242 Location: Texas, USA
Posted: Wed Nov 10, 2021 15:44 Post subject:
Glad to here you got it sorted. Obvious answers that should've been achieved sooner, perhaps. All of that is what I couldn't quite remember from seeing this situation before (and did not do a proper forum search for). Thanks for the update. _________________ "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
@kernel-panic69, you are right… looking back at the whole process, the answer should have been obvious earlier. I think what complicated things for me (besides my lack of knowledge) is that:
- swconfig was just recently implemented for DD WRT Broadcom chipsets and many posts reference nvram settings.
- R8000 switch did not accept some common swconfig command attributes making it impossible to set tagging up through swconfig alone.
- Ports are mapped differently at physical layer, logical layer and in WebUI (e.g. R8000 physical port 4 is logical port 3 and WebUI port 1).
- VLAN Tags can both be set through WebUI Switch Config and Networking page. Both have impact on the available interfaces so good luck finding the right combination of settings.
- One of the R8000 CPU ports is not mapped in WebUI and cannot be controlled through WebUI while swconfig support is limited. This could potentially be an issue for some advanced setups.
- Correct WebUI setup must still be supplemented by nvram settings.
The Conclusion:
For Qualcomm Atheros: stick with swconfig. It is easy to learn, clean, simple and intuitive.
For Broadcom: Identify all the ports properly at all three tiers, stick with WebUI setup for the time being and for the love of God, DO NOT TOUCH Networking->VLAN Tagging.
I gave this issue one last try and finally managed to get it working. Thanks once again kernel-panic69, Alozaros and egc.
1: WebUI, Setup
Connection Type: PPPoE
Username & Password from ISP
Save / Apply
2: WebUI, Setup -> Switch Config:
Add VLAN 101
WAN Port: Uncheck VLAN 2, Check VLAN 101, Check Tagged
Port 1: Check VLAN 1, Uncheck Tagged
Port 2: Check VLAN 1, Uncheck Tagged
Port 3: Check VLAN 1, Uncheck Tagged
Port 4: Check VLAN 1, Uncheck Tagged
Port 5: Check VLAN 1, Uncheck Tagged
Save / Apply
3: WebUI, Setup -> Networking:
Port Setup -> WAN Port Assignment: vlan101
Network Configuration vlan101: Unbridged (not necessary for PPPoE connection)
Save / Apply
4: Telnet one time commands:
nvram set pppoe_wan_ifname="vlan101"
nvram commit
reboot
DO NOT TOUCH WebUI->Setup->Networking->VLAN Tagging
What firmware version did it end up working on with this configuration?
I will have to do the same but with VLAN 7 for a Deutsche Telekom FTTH connection on an RT-N66u.
Hi all,
I followed the configuration on a R7000 with a german ISP (htp). VLAN is 22.
Now I get an IP for IPv4 and IPv6 (6in4 tunnel).
Nothing else was configured, first I wanted to get PPPoE to work.
Unfortunately, I can't access internet, ping also doesnt work vial LAN.
What I am doing wrong? Do I have to set it up as router or gateway?
Do I have to set something in the IPv6 TAB?