What command for VLAN untag and tag?

Hello,

I have followed below URL, but don’t understand how to setup untag and tag on trunk port.
http://wiki.mikrotik.com/wiki/Manual:Interface/VLAN#Q-in-Q

Thanks !

Simply - everything configured as “/interface vlan” is tagged. And tag is specified for every interface separately. Everything configured directly on a physical interface or bridge - is untagged. Few examples:

  1. I set interface vlan10 with tag 10 and vlan20 with tag 20, both on ether3. And then I bridge vlan10 with ether1 and vlan20 with ether2. Then ether1 has vlan10 untagged, and ether2 - vlan 20 untagged. Ether3 has tagged vlans 10 and 20. And an untagged vlan, if you want, also :slight_smile:. To add an IP address in vlan10, you put it on the bridge with vlan10. To add an IP address on untagged vlan on ether3 - you put it directly on ether3.

  2. I add interfaces:
    vlan10-e1 - on port ether1 with tag 10
    vlan20-e1 - on port ether1 with tag 20
    vlan10-e2 - on port ether2 with tag 10
    vlan20-e2 - on port ether2 with tag 20
    And then I bridge vlan10-e1 with vlan20-e2, and bridge vlan10-e2 with vlan20-e1… And what now?
    Yeah, what comes on ether1 with tag 10, goes on ether2 with tag 20. And vice versa.

  3. I bridge ether1 with ether2. So then the untagged and every tagged vlan is transparent on the ethers, without even adding vlan interfaces :slight_smile:. To add an IP address on a vlan, I create interface vlan on the bridge - and then IP on the vlan. To add IP on untagged vlan - I just add it on the bridge.

  4. I have vlan10, vlan20, and vlan30 on ether1, tagged. And I want vlan20 and vlan30 to be tagged on ether2, but vlan10 to be untagged on ether2… I want to “untag” one vlan, having the rest tagged… And than - I cannon do that! Yeah, that’s not a fully functional vlan switch… As you can read somewhere on the forum, even RB250G - the vlan switch - doesn’t support that.

Hello dasiu,

Thank for your explain, it seem complex …

Be simple: for example, I have two RouterOS for VLAN, RouterOS A has VLAN 10 and VLAN 20, also RouterOS B has VLAN 10 and VLAN 20, trunk between RouterOS A and RouterOS B, all VLAN ports is tagged.

Can RouterOS A VLAN 10 communicate with RouterOS B VLAN 10 ?

Thanks !

Of course :slight_smile:. Let’s assume, that the trunk port is ether1. On both Routers:
/interface vlan add name=vlan10 interface=ether1 tag=10
/interface vlan add name=vlan20 interface=ether1 tag=20
/ip address add address=192.168.10.1/24 interface=vlan10 (or 192.168.10.2 on second router)
/ip address add address=192.168.20.1/24 interface=vlan10 (or 192.168.20.2, or course)

Hello,

I created below diagram, can you share your exp by this diagram ?

Thanks !

If you want to bridge the vlans (that both subnets labeled as “vlan10” would be bridged together), than why do you put different IP addressing? Vlan10 should have the same IP pool on both routers… I think that’s the idea of trunking :slight_smile:.

Sorry, I want to do VLAN routing after VLAN interface configed correctly, I know what you mean.

I think if only VLAN (no routing), no need to define VLAN gateway, right ?
/ip address add address=192.168.10.1/24 interface=vlan10 (or 192.168.10.2 on second router)
/ip address add address=192.168.20.1/24 interface=vlan10 (or 192.168.20.2, or course)