Mikrotik

Serial Port

How to change the baud rate on the console port:

:::Text only
/system console disable 0
/port set serial0 baud-rate=19200 data-bits=8 parity=none stop-bits=1
/system console enable 0

http://wiki.mikrotik.com/wiki/Serial_Port_Usage

VLANs on series 1 cloud router switches

Long ago replaced a handful of Dell switches with Mikrotik Cloud Router Switches. They are inexpensive, fairly capable, and have some really cool built in tools. How many other sub-$200 gigabit switches have packet capture? These old series 1 switches still work and still receive updates after 10 years.

CRS125-24G-1S-RM

I use a handful of VLANs, and I had trouble finding clear documentation on how to set this up. Here is the configuration from one of my switches:

Note: Series 3 (modern) switches are configured differently and more easily. So don’t do use this for modern gear!

/interface vlan
add interface=ether24 l2mtu=1584 name=vlan100 vlan-id=100
add interface=ether24 l2mtu=1584 name=vlan101 vlan-id=101
add interface=ether24 l2mtu=1584 name=vlan102 vlan-id=102
add interface=ether24 l2mtu=1584 name=vlan103 vlan-id=103
add interface=ether24 l2mtu=1584 name=vlan104 vlan-id=104
add interface=ether24 l2mtu=1584 name=vlan288 vlan-id=288
add interface=ether24 l2mtu=1584 name=vlan289 vlan-id=289

/interface ethernet
set [ find default-name=ether1 ] master-port=ether24
set [ find default-name=ether2 ] master-port=ether24
  ...
set [ find default-name=ether20 ] master-port=ether24
set [ find default-name=ether21 ] comment=TRUNK master-port=ether24
set [ find default-name=ether22 ] comment=TRUNK master-port=ether24
set [ find default-name=ether23 ] comment=TRUNK master-port=ether24
set [ find default-name=ether24 ] comment=TRUNK

/interface ethernet switch egress-vlan-tag
add tagged-ports=ether21,ether22,ether23,ether24,switch1-cpu vlan-id=100
add tagged-ports=ether21,ether22,ether23,ether24 vlan-id=102
add tagged-ports=ether21,ether22,ether23,ether24 vlan-id=289
add tagged-ports=ether21,ether22,ether23,ether24 vlan-id=104
add tagged-ports=ether21,ether22,ether23,ether24 vlan-id=103

/interface ethernet switch ingress-vlan-translation
add customer-vid=0 new-customer-vid=289 ports=ether19,ether20 sa-learning=yes
add customer-vid=0 new-customer-vid=101 ports=ether1,ether2 sa-learning=yes
add customer-vid=0 new-customer-vid=102 ports="ether3,ether4,ether9,ether10,et\
    her11,ether12,ether13,ether14,ether15,ether16" sa-learning=yes
add customer-vid=0 new-customer-vid=103 ports=ether5,ether6 sa-learning=yes

/interface ethernet switch vlan
add ports="ether3,ether4,ether9,ether10,ether11,ether12,ether13,ether14,ether1\
    5,ether16,ether21,ether22,ether23,ether24" vlan-id=102
add ports=ether1,ether2,ether21,ether22,ether23,ether24 vlan-id=101
add ports=ether5,ether6,ether21,ether22,ether23,ether24 vlan-id=103
add ports=ether21,ether22,ether23,ether24 vlan-id=288
add ports=ether19,ether20,ether21,ether22,ether23,ether24 vlan-id=289
add ports=ether21,ether22,ether23,ether24 vlan-id=104
add ports=ether21,ether22,ether23,ether24,switch1-cpu vlan-id=100

/interface ethernet switch
set forward-unknown-vlan=no

One thing that was awkward at first was that you have to assign a master port to each interface that you’re using. Since I’m using these as switches, and not routers, all used ports are attached to ether24, as opposed to switch1-cpu. Either set this up on all ports at first, or remember this when you try to use a new port and can’t figure out why it is dead.

Note that switch1-cpu is on VLAN 100, as I want all device management traffic segregated.

Ports 21 through 24 are trunk ports. These need to have the VLAN tags configured in a switch egress-vlan-tag section.

Untagged ports need a “switch ingress-vlan-translation” configuration. Tell the switch that “customer-vid” 0 should be assigned to the desired VLAN tag.

All ports participating in VLANs need a “switch vlan” configuration. Regardless of whether the ports are tagged or untagged.

“set forward-unknown-vlan=no” tells the switch to drop unconfigured VLAN traffic. Once things are working, you should set this to prevent traffic from leaking.