VLAN Detached Networks on R9000

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page Previous  1, 2, 3 ... , 9, 10, 11  Next
Author Message
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5700

PostPosted: Sat Oct 15, 2022 2:58    Post subject: Reply with quote
I know it is a lot to take in, but Ctrl+F "VLAN" first match Contents -> 3 Functional Description -> 3.3 VLAN. 4096.
Maybe there is a limitation elsewhere that I am not aware of but switches themselves should match this datasheet.
Sponsor
DWCruiser
DD-WRT User


Joined: 15 Aug 2016
Posts: 223
Location: Melbourne, Australia

PostPosted: Sat Oct 15, 2022 3:17    Post subject: Reply with quote
blkt wrote:
I know it is a lot to take in, but Ctrl+F "VLAN" first match Contents -> 3 Functional Description -> 3.3 VLAN. 4096.

Maybe there is a limitation elsewhere that I am not aware of, but switches themselves should match the datasheet.


Sure. I just don't understand the point of citing the two linked docs which do not address the reason for why only 512 VLANS are available on the R9000's switch in the first place.

_________________
Life is a journey; travel alone makes it less enjoyable and lonely.
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5700

PostPosted: Sat Oct 15, 2022 3:24    Post subject: Reply with quote
DWCruiser wrote:
Sure. I just don't understand the point of citing the two linked docs which do not address the reason for why only 512 VLANS are available on the R9000's switch in the first place.
Can't help you there. If 512 is truly the limit, because reasons, take a look at overall hardware layout or DD-WRT.
But then again, I am not Per Yngve Berg, wait for an answer as he very likely knows a lot more than I do about it.
DWCruiser wrote:
If you can be so kind. Is there a quick way, like a command, to find out the actual number of VLANS on a switch?
I answered the question.
kernel-panic69
DD-WRT Guru


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

PostPosted: Sat Oct 15, 2022 3:51    Post subject: Reply with quote
AR8337 = QCA8337*

https://github.com/mirror/dd-wrt/commit/2ecea4e31933b861600257b30811cf93e9de728c

_________________
"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
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5700

PostPosted: Sat Oct 15, 2022 3:52    Post subject: Reply with quote
Okay thanks, so DD-WRT is certainly not a limitation.
kernel-panic69
DD-WRT Guru


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

PostPosted: Sat Oct 15, 2022 3:54    Post subject: Reply with quote
Not to my knowledge, and I generally don't question what PYB says because it's usually based on experience, so there may be something I'm missing... only way to find out is try adding a vlan above 512 via swconfig.
_________________
"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
DWCruiser
DD-WRT User


Joined: 15 Aug 2016
Posts: 223
Location: Melbourne, Australia

PostPosted: Sat Oct 15, 2022 5:43    Post subject: Reply with quote
Is 911 the same as any number above 511 but less than 1024, from 10bits of the VLAN tag (i.e. 2x2x2x2x2x2x2x2x2x2)?

That is based on 10bits, instead of the normal 12bits set aside for VLAN ID of 802.1q tag.

(Edited to account for binary values, starting at 0).

_________________
Life is a journey; travel alone makes it less enjoyable and lonely.


Last edited by DWCruiser on Sat Oct 15, 2022 17:34; edited 1 time in total
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2977
Location: Germany

PostPosted: Sat Oct 15, 2022 6:51    Post subject: Reply with quote
my r7800 has a similar switch (QCA8337)

Code:
#!/bin/sh
i=-1
while [ $i -ne 4095 ]
do
        i=$(($i+1))
        sleep $((1/5))
        swconfig dev switch0 vlan $i set ports 4
        echo "$i"
done

swconfig dev switch0 set apply
swconfig dev switch0 show

VLAN 0:
   vid: 0
   ports: 4t
VLAN 1:
   vid: 1
   ports: 4t
VLAN 2:
   vid: 2
   ports: 4t
VLAN 3:
   vid: 3
   ports: 4t
VLAN 4:
   vid: 4
   ports: 4t
VLAN 5:
   vid: 5
   ports: 4t
...................................

VLAN 4092:
   vid: 4092
   ports: 4t
VLAN 4093:
   vid: 4093
   ports: 4t
VLAN 4094:
   vid: 4094
   ports: 4t
VLAN 4095:
   vid: 4095
   ports: 4

swconfig dev switch0 vlan 4096 set ports 4
failed


Shocked


Last edited by ho1Aetoo on Sat Oct 15, 2022 8:15; edited 1 time in total
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5700

PostPosted: Sat Oct 15, 2022 8:07    Post subject: Reply with quote
This is in both QCA8337 and QCA8337N:

"supports a maximum of 4096 entries in the VLAN table. The device supports 4096 VLAN ID, ranging from 0 to 4095."
DWCruiser
DD-WRT User


Joined: 15 Aug 2016
Posts: 223
Location: Melbourne, Australia

PostPosted: Wed Oct 19, 2022 5:20    Post subject: Reply with quote
As i still have the loan of a friend's R9000 till weekend, i went on a mission to find out the maximum number of VLANs of R9000 switch.

Findings (based on DD-WRT v3.0-r50500 std (10/13/22))

1. R9000 running DDWRT has a maximum 128 VLANS (between 0 and 127).

2. But, WAN port (at default VLAN 2) can be tagged with any vid X, where X is any number between 0 and 4095.

However, if swconfig dev switch0 vlan 2 set vid X is used, the normal functions of VLAN become very flaky to the extent of unusable. It's possible that they can co-exist, but i am not aware if there is a way to overcome it.

_____________
The above is simply a verification of R9000 switch's capability when running DDWRT. AFAIK, there is no shortcut to find out the max number of VLANS from inside a switch. Not from a document.

Note: I am not an expert in Linux CLI. But a keen student, leaning on others' knowledge to build mine, when needed. And share it.

_________________
Life is a journey; travel alone makes it less enjoyable and lonely.
icepeek
DD-WRT Novice


Joined: 03 Oct 2022
Posts: 5

PostPosted: Sun Oct 23, 2022 0:12    Post subject: Reply with quote
DWCruiser wrote:
icepeek wrote:
Hi DwCruiser,

Unfortunatly not... Any help would be much appreciated.

Thank you.


As i still have a R9000 on loan from a good friend, i applied and ran Per Yngve Berg's suggestion and found that it does work. Well, after several hours of testing, on and off, during last couple of days. Very Happy

Some explanation is necessary. I think.

My educated guess is possibly due to some intended 'functional space saving' (?) by BS, fewer than 911 VLANS were made readily available as is on R9000 under DDWRT. It kinda explains why VLAN20 works, but VLAN911 does not. After all, there should be 4,096 VLANS. In theory, that is.

Luckily, Per Yngve Berg's approach works by masking VLAN with a different label 911 to accommodate the required tagging by your ISP.

In steps (cumbersome, i know, but is needed to minimize potential variations in troubleshooting):


__________________________________________________
Tested in r50500
Note: all Reboots are done by /Administration/Management/Reboot Router
__________________________________________________


1. Reset router
2- Also clear out your web browser cache.
3- Configure Setup to use PPPOE with username and password provided by the ISP
4- Setup wireless (for backdoor in, if desired)
5- Add the following script:


--->Startup CLI:

sleep 6
# Set up VLAN ports and id
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 2 set ports "3t 5t"
swconfig dev switch0 vlan 2 set vid 911
swconfig dev switch0 set apply


Save settings


--- Firewall

iptables -t nat -I POSTROUTING -o `get_wanface` -j MASQUERADE


After router comes back (wait till the first four light indicators from left are lit up as normal).

Do another reboot
Go to Setup/Networking, under Interface, add eth2 and tag 911
Reboot router (for eth2.911 to be available)
Next, goto Port Setup, for WAN port assignment, select eth2.911
Save settings
Now, do a final reboot.

You should, hopefully, have PPPoE connection with WAN tagged at 911 working now. If stuck, see note below for further info.

Let me know how you go so others can benefit from our discussion.

Good luck.
______________________


P.S. In my specific setup, the test R9000 (R2) is placed behind my main router (R1), and in a separate VLAN of its own (as configured on R1). R1 is, in turn, placed behind my ISP modem. So i actually had to disable/re-enabled/refresh my laptop's LAN connection for R2 to finally get the correct designated WAN IP from R1 as per my configuration.

These on/off steps were used in my setup as a workaround, but may not be needed elsewhere. But just in case you need since i do not use a PPPoE connection for testing. Cheers


Hi DWCruiser,

Thanks for comming back to me. I been busy setting up a machine I had with pfsense, so I could have a working router internet while sorting out the R9000. I finally was able to get the R9000 with an IP, with your configuration above. However, when I do some internet testing I dont get the speeds I get with pfsense or with the stock firmware. Could it be thst this configuration is not optimized for a gigabit connection? I'm still doing some testing, but just wanted to make sure we were not taking away one issue and bringing another one with the setup.

I will keep you posted.
Per Yngve Berg
DD-WRT Guru


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

PostPosted: Sun Oct 23, 2022 8:58    Post subject: Reply with quote
[quote="icepeek"]
DWCruiser wrote:

swconfig dev switch0 vlan 2 set ports "3t 5t"
swconfig dev switch0 vlan 2 set vid 911


You have tagged both the WAN port and the Processor Port. By not tagging the processor Port, the WAN will stay at it's original interface. No need for the tagging section in the GUI.
icepeek
DD-WRT Novice


Joined: 03 Oct 2022
Posts: 5

PostPosted: Sun Oct 23, 2022 12:34    Post subject: Reply with quote
[quote="Per Yngve Berg"]
icepeek wrote:
DWCruiser wrote:

swconfig dev switch0 vlan 2 set ports "3t 5t"
swconfig dev switch0 vlan 2 set vid 911


You have tagged both the WAN port and the Processor Port. By not tagging the processor Port, the WAN will stay at it's original interface. No need for the tagging section in the GUI.


Are you saying that because of this the performance I'm getting is not ideal? @Per
p1nky
DD-WRT Novice


Joined: 14 Feb 2014
Posts: 14

PostPosted: Wed Jan 04, 2023 9:42    Post subject: Reply with quote
DWCruiser wrote:
I borrowed a spare R9000 from a friend for a drink Smile to test the settings below. And they work with my DHCP. I am reasonably confident that they should work with your PPPoE as well.

Given that a few changes have been done to the R9000's internal logic during last couple of days, as well as the web browser. I strongly suggest the following be done first:

_________________________________
1. Do a hard reset of the router.
2. Also clear out your web browser cache.
_________________________________


Now, configure the R9000 so a wireless connection is available, if needed.

Next, reboot R9000 and ensure that the wireless connection works.


Next, enter the following: (see pic.1)

---(for Startup)

sleep 6
# Setup VLANS
# Switch0 Config
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports "0t 1 2 4t 6t"
swconfig dev switch0 vlan 20 set ports "3t 5t"
swconfig dev switch0 set apply
# Assign WAN to VLAN20 and up
vconfig add eth2 20
ifconfig vlan20 up


--- Save Startup


Next, (for Firewall)

iptables -t nat -I POSTROUTING -o `get_wanface` -j MASQUERADE

---Save Firewall (the router will reboot itself. Wait till the router is back. Now do a reboot. (yes, a second one)

Wait till it comes back.

Now goto Setup/Networking

Under Interface --->enter ether 2
Under Tag Number --->enter 20

(See pic.2)

Next goto Port Setup, for WAN port assignment, select eth2.20 (see pic.3)

Save settings. Then do a reboot. Wait till the router fully comes back.

Hopefully, you should now have Internet connection.

P.S. To answer a question of yours earlier. The WAN port on R9000 is port 3 on switch0. 3t is tagging the WAN port.


Thanks for this, I just tried this here with my FTTH provider which uses VLAN ID 31 and it works fine on firmware r51140 std (12/31/22).

For me I also had to reboot after setting the VLAN Tagging via the UI, before eth2.31 could be selected and then I needed another reboot and also it took a bit until I got an IP.

I get the "full" Gigabit speed (940mbps) in speed tests.

Here for convenience the full startup script for VLAN ID 31 (same as above but 20 replaced with 31 in the necessary places):

Code:
sleep 6
# Setup VLANS
# Switch0 Config
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports "0t 1 2 4t 6t"
swconfig dev switch0 vlan 31 set ports "3t 5t"
swconfig dev switch0 set apply
# Assign WAN to VLAN31 and up
vconfig add eth2 31
ifconfig vlan31 up


Firewall is the same and in UI obviously you have to set 31 as tagging instead of 20 and then select eth2.31
tigs
DD-WRT User


Joined: 25 Sep 2011
Posts: 84

PostPosted: Sun Jan 22, 2023 16:23    Post subject: Reply with quote
Thank you very much @ DWCruiser

Your excellent guide help me with my setup.

I have made a port_map, but I am not sure i understood and drew it correctly. Hopefully you can fix any errors in it.
Goto page Previous  1, 2, 3 ... , 9, 10, 11  Next Display posts from previous:    Page 10 of 11
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