Community discussions

MikroTik App
 
bobertperry
newbie
Topic Author
Posts: 44
Joined: Tue Jan 06, 2009 4:05 am

Adding vlan tags

Tue Dec 01, 2009 11:23 pm

I must be missing something. Just to test I want to add vlan tag 34 to anything coming in port 2 that is not tagged and and treat port1 like a trunk port.


 
/interface ethernet
set 0 arp=enabled auto-negotiation=yes bandwidth=unlimited/unlimited comment=\
    "" disabled=no full-duplex=yes l2mtu=1524 mac-address=00:0C:42:70:7B:7A \
    master-port=none mtu=1500 name=ether1 speed=100Mbps
set 1 arp=enabled auto-negotiation=yes bandwidth=unlimited/unlimited comment=\
    "" disabled=no full-duplex=yes l2mtu=1524 mac-address=00:0C:42:70:7B:7B \
    master-port=ether1 mtu=1500 name=ether2 speed=100Mbps

...



/interface ethernet switch
set switch1 mirror-source=none mirror-target=none name=switch1
/interface ethernet switch port
set (unknown) vlan-mode=secure
set (unknown) vlan-mode=secure
set (unknown) vlan-mode=fallback
set (unknown) vlan-mode=fallback
set (unknown) vlan-mode=fallback
/interface ethernet switch rule
add copy-to-cpu=no disabled=no mirror=no new-vlan-id=34 ports=ether2 \
    redirect-to-cpu=no switch=switch1 vlan-header=not-present
/interface ethernet switch vlan
add disabled=no ports=ether2,ether1 switch=switch1 vlan-id=34
add disabled=no ports=ether1 switch=switch1 vlan-id=0

What am I missing? How do I add vlan tags to packets?
 
User avatar
butche
Trainer
Trainer
Posts: 430
Joined: Fri May 28, 2004 6:14 pm
Location: Missouri, USA
Contact:

Re: Adding vlan tags

Wed Dec 02, 2009 9:18 am

I must be missing something. Just to test I want to add vlan tag 34 to anything coming in port 2 that is not tagged and and treat port1 like a trunk port.What am I missing? How do I add vlan tags to packets?
ether1 = trunk for vlan34
ether2 = traffic untagged leaving there, but "connected" to vlan34
# Create vlan on ether1 for trunking
/interface vlan
add interface=ether1 vlan-id=34 name=vlan34_Iface
# Create a bridge
/interface bridge
add name=vlan34_bridge
# Add ports to the bridge
/interface bridge ports
# ether2 is untagged
add bridge=vlan34_bridge interface=ether2
# add the tagged interface
add bridge=vlan34_bridge interface=vlan34_Iface
Traffic LEAVING the router on ether2 is untagged, traffic ENTERING on ether2 will be bridged to vlan34 and will be tagged when it leaves the router.
 
bobertperry
newbie
Topic Author
Posts: 44
Joined: Tue Jan 06, 2009 4:05 am

Re: Adding vlan tags

Wed Dec 02, 2009 6:55 pm

Thanks.

I knew I could do this on the router's CPU as well but for some reason unknown to myself I want to do this on this switch chip. Though it looks like I will probably end up doing it this way or actually routing with the router.

Thanks for the pointers :D

Rob
 
jerryroy1
Member Candidate
Member Candidate
Posts: 172
Joined: Sat Mar 17, 2007 4:55 am
Location: LA and OC USA
Contact:

Re: Adding vlan tags

Wed Dec 30, 2009 11:54 pm

How do I add multiple ports to the same vlan?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Adding vlan tags

Wed Dec 30, 2009 11:56 pm

Add additional ports to the bridge.