OpenWrt Forum Archive

Topic: Tagged and untagged Ports/What is '*'?

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

Hello,

I want to have:
Port 4: WAN, untagged
Port 3: LAN1, untagged
Port 2: LAN2, untagged
Port 1: LAN3, untagged
Port 0: All above, tagged

Is this the correct config?

config switch        "eth0"
    option vlan0    "0t 3u 5*"
    option vlan1    "0t 4u 5"
    option vlan2    "0t 2u 5"
    option vlan3    "0t 1u 5"

Why? Why not? Is it possible to omit the "t" and "u" prefixes? (I.e. does the driver set the tagged/untagged mode automatically?)

And finally: I still do not understand the meaning of the '*'. What the hell does "Set the default VLAN (PVID) of the Port to the current VLAN" [1] mean? What is a default VLAN and what is the current VLAN?

Regards,
diff()

[1] http://downloads.openwrt.org/kamikaze/docs/openwrt.html

5* is the port on the CPU.

Hi,

Yes, I know, but what is exactly the asterisk (*) for? Why do I need it and why is I used only once?

However, I have tried setting a tagged VLAN and I failed :-(

config switch eth0
        option vlan0    "3 0t 5*"
        option vlan1    "4 0t 5"
        option vlan2    "2 0t 5"
        option vlan3    "1 0t 5"

All ports work except the tagged port 0. Does anybody know why? What could be the problem? Best regards,
divB

The * means the "default VLAN" for a given port.

It tells the switch which port to send packets to if they do not have a destination VLAN, for example if you send packets directly to eth0 instead of eth0.0

So if you send an untagged packet, or a packet tagged with 0, and it is coming from the CPU, then only ports 3 and 0 will receive it.
Ports 4 2 or 1 will only receive a packet if you tag it with 1, 2 or 3 respectively but will not receive an untagged message.

Generally this distinction is not useful because most hosts will usually either support 802.1q, or they will not support it at all. But it may matter if you chain another switch, or connect a bridged host to a port that is a member of more than one VLAN.

For non-CPU ports, "u" is the default. For CPU ports, "t" is the default. That is why you often see it omitted, but it never hurts to be more explicit.

(Last edited by phorn on 14 Apr 2009, 01:07)

I'm sorry but that's not really correct.

The * is effectively the "default VLAN", but it is used this way by a switch : if the concerned port receives an untagged packet, it tells the switch in which VLAN to put it (and not the other way round).

So in our case it means that all packet coming from eth0 (CPU interface internally connected to the 5th port), should be put in VLAN 0.

As the default configuration on OpenWRT is to use eth0.0 but not eth0, it's absolutely useless... because no untagged packet are ever received on port 5
(except perhaps special packets transmitted out on eth0 by the switch driver to configure, I didn't dug into this low-level of OpenWrt)

For your problem, how do you use the tagged port 0 ? (a "tagged vlan" has no sense, all you have are vlan-tagged packets) 

The PC connected to this port should be configured with corresponding VLAN subinterfaces.

The discussion might have continued from here.