OpenWrt Forum Archive

Topic: How do VLAN's work

The content of this topic has been archived on 14 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi I've just installed RC2 for my Linksys WRT1900AC and so far I've got the internet and Wi-Fi working. However, as this is so much more advanced compared to stock firmware than the commercial routers most people are used to with stock firmware I'm trying to understand all of the menus on the router and make the most out of CFW.

Currently I'm trying to get my head around network interfaces and VLAN's because initially when I opened the OpenWRT GUI for the first time I went into the 'Network > Swtich' and disabled and deleted the VLAN listings and my connection to the router was completely lost, leaving me no choice but to factory reset the router via reset pin. From my understanidng each port represents the hardware ports on the router itself but I don't have anything easily labelled as all I see is

Port 0    Port 1    Port 2    Port 3    Port 4    CPU    Port 6

and listed from the drop down boxes
off
untagged
tagged

Why when I delete the default VLAN rules I lose all connectivity to my router? This is all completely newbie to me and I've tried all of the official OpenWRT Wiki pages and other websites and it's not making sense. If someone can shed some light on this with easy explanations etc. I would be highly grateful of it.

Many thanks

Will

(Last edited by willowen100 on 26 Jun 2015, 20:08)

This image linked on the model's wiki page, is a hardware map from the physical ports on the back of the router (top row) to the logical ports in the switch (middle row).  The bottom row shows that there are two ports into the CPU, connected to 5 and 6 on the switch.
https://s3.amazonaws.com/Justin.Schuhma … layout.png

The switch has to use VLANs to make this hardware arrangement work and have two paths through the switch so the two CPU ports are dedicated to the wan and lan functionality.  Without VLANs, the two CPU ports would be seeing the same traffic and likely end up contending with each other.  Since this VLAN switching is done by dedicated hardware, there is no performance loss.

What do you need the router to do instead of the default setup?  If you are for example, not using a WAN connection and want all 5 Ethernet ports to be lan, just move port 4 to the other VLAN by making it "untagged" in VLAN 1 and "off" in VLAN 2.

I'm still confused how these VLAN's connect with one another. I understand 0-4 represent the physical ports on the back of the router, but it's the internal one's that are throwing me. Additionally alongside these ports is the configuration on web GUI. What's the difference between 'off, untagged & tagged'? How does each port link up? What's the diagram flow; do I read the GUI from left to right?

Please forgive if I'm asking lots of questions. I really want to understand OpenWRT and if I can understand everything dumbed down with analogies and examples with explanations it'll click eventually. I have some knowledge on routers from just doing trial and error, but most of these routers are locked down and become very difficult to brick or lock yourself out of if you mess something up. OpenWRT on the other hand is Linux and extremely versatile (command based in a sense; a reason which is why I never liked the OS's for desktop use). Yes okay there is a Luci GUI, but this is way more advanced than your standard router.

I help loads of people with internet issues especially within my gaming group as internet is important to us. If I can get to grips with this powerful firmware I can tell everyone how good it is.

Thank you for hearing me out

Will

The rules are there for a reason. As you noticed, without them, the router won't function as intended by the manufacturer.

The states are rather self-explanatory:

  • Off: not part of the VLAN

  • Untagged: part of the VLAN (usually only that VLAN)

  • Tagged: part of multiple VLANs. Tagging is required for the switch to be able to separate traffic

You should SSH into the router and check the actual config files, they're often easier to read than the web interface (because the web interface splits stuff up and dumbs stuff down here and there). It's all there in one place - /etc/config/network, and with a bit of reading up you'll understand (might be a steep learning curve depending on how your IT skills are).

And no, the outside numbering scheme bears no relation to the internal port numbering. Again, that's not something OpenWrt influences; it has to work with the hardware as designed by its respective manufacturers.

As for reading the GUI, any Latin alphabet GUI works from left to right. It does not matter how OpenWrt orders the ports, you need to keep in mind they represent the internal port numbering.

Most people need never touch the VLAN setups; you're trying to jump to one of the more complex features of OpenWrt without understanding the basics. So first find your way around the CLI, get familiar with the crucial configuration files, then try your hand at VLANs. If you would have needed VLANs, you probably would have known what they are and what they do, and also that you shouldn't disable them on a device that has them by default wink.

Thanks for the reply. I will  definitely check out the config files over SSH. I've been looking into setting up a guest WLAN and some of the guides on the internet mention about creation g a separate VLAN. How would go about doing that?

Also i looked at creating a DMZ or a NAT pass through for my Sony PS3 as I want to try NAT type 1. How would I set that up with VLAN's?

Cheers for this help so far

Will

The discussion might have continued from here.