MikroTik Port Switching
You can now get MikroTik training direct from Manito Networks. MikroTik Security Guide and Networking with MikroTik: MTCNA Study Guide by Tyler Hart are both available in paperback and Kindle!
Preface
While MikroTik does sell switches, many organizations deploy SOHO RouterBOARD models to small, remote offices with only a few devices. This is very common inside residential networks as well. Switching ports connected to local devices and using one port for an internet connection makes the most sense for these locations, rather than deploying a separate switch and router. There are a couple ways to combine ports in a switched (bridged) configuration depending on what RouterOS version we're running.
On a given router we have interfaces ether1 through ether5. We'd like to use ether1 for the WAN connection, and ether2 - ether5 as a switch. We'll plug in desktops, a printer, and a NAS - all hosts should be able to communicate with each other on the same LAN.
Master Port Configuration
Using a Master Port is the way ports were bridged prior to the 6.4x versions of RouterOS. One port is set aside as the master port, and the others that need to be switched are configured to use it. All ports configured for that master, and the master port itself, become part of the same switched local network. This is very simple to implement, but unfortunately this configuration doesn't benefit from hardware acceleration. Since ether2 is the first port on the switch we'll use it as the Master Port.
The following commands configure ports ether3 - ether5 to use ether2 as the Master in a switched configuration:
/interface ethernet
set ether3,ether4,ether5 master-port=ether2
In Winbox and at the console ether3, ether4, and ether5 should be running and in a "slave" status if they are connected. A DHCP server or other service running on ether2 would now be available to hosts connected to the other switched ports.
Hardware Bridge Configuration
The new method of bridging ports benefits from hardware acceleration and delivers line-rate switching. The configuration is a bit more complex, but still straightforward overall. Bridge interfaces and port configurations are used to combine ports in a switched configuration. First we'll create a bridge, then add ports to it while enabling the hardware option.
Create a bridge with the following commands:
/interface bridge
add name=Switch comment="Switched ports" fast-forward=yes
Use the "protocol-mode" option with the command above to configure Spanning Tree Protocol as needed. Options include STP, RSTP, and MSTP. Now add ports ether2 - ether5 to the bridge and use the "hw=yes" option:
/interface bridge port
add interface=ether2,ether3,ether4,ether5 bridge=Switch hw=yes
Once these ports are connected they should also be operating with the "Running" and "Slave" statuses.