Manual:CRS Router: Difference between revisions

From MikroTik Wiki
Jump to navigation Jump to search
Line 21: Line 21:
<pre>
<pre>
/interface bridge
/interface bridge
add name=bridge vlan-filtering=yes
add name=bridge vlan-filtering=no
</pre>
</pre>


Line 154: Line 154:
/interface ethernet set [find where name="sfp-sfpplus2"] disabled=yes
/interface ethernet set [find where name="sfp-sfpplus2"] disabled=yes
</pre>
</pre>
{{ Note | Create a bridge with VLAN filtering disabled at first. If you have misconfigured the VLAN table, you will not be able to access to switch. Enable VLAN filtering only on CRS3xx series devices and only when you have finished configuring VLANs.}}


===Management port===
===Management port===

Revision as of 16:44, 15 November 2017

Version.png

Applies to RouterOS: v6.41 +


Summary

MikroTik's CRS series devices are powerful switches that also have routing capabilities. In some cases it is sufficient to use the CRS built-in CPU to handle some functions that are meant to be done by a router, not a switch. The CRS series devices can be used as a router and as a switch at the same time, this is useful for networks that focus on internal network throughput and don't require a large throughput to the Internet.

Icon-warn.png

Warning: CRS series devices are NOT designed to handle large amounts of traffic through the CPU, for this reason be very careful when designing your network since large amounts of traffic that are passing through the CPU will overload it. Functions that depend on the CPU (for example, NAT and DHCP) will not work properly when the CPU is overloaded.


Alt text
CRS1xx/CRS2xx port trunking with port based VLANs

In this setup SwitchA is going to be our Switch-Router that will use port based VLANs while SwitchB is going to extend the amount of ports. Switch's ports are going to be divided into 3 groups, each group will tag the ingress traffic (access ports) with the appropriate VLAN ID, while the SFP+ port will be used as a trunk port to forward traffic between switches. In this setup a large throughput between each port is expected (except for the WAN port). This guide is written for CRS326-24G-2S+, but it can be used for any other CRS series device that is capable of running RouterOS.

Port switching

  • In case you are using a CRS3xx series device:

All switches in this setup require that all used ports are switched together. Use these commands on SwitchA, SwitchB:

/interface bridge
add name=bridge vlan-filtering=no

There will be different ports assigned to each switch to a bridge since one switch will have a WAN port. Use these commands on SwitchA:

/interface bridge port
add bridge=bridge interface=ether2 pvid=1001
add bridge=bridge interface=ether3 pvid=1001
add bridge=bridge interface=ether4 pvid=1001
add bridge=bridge interface=ether5 pvid=1001
add bridge=bridge interface=ether6 pvid=1001
add bridge=bridge interface=ether7 pvid=1001
add bridge=bridge interface=ether8 pvid=1001
add bridge=bridge interface=ether9 pvid=1002
add bridge=bridge interface=ether10 pvid=1002
add bridge=bridge interface=ether11 pvid=1002
add bridge=bridge interface=ether12 pvid=1002
add bridge=bridge interface=ether13 pvid=1002
add bridge=bridge interface=ether14 pvid=1002
add bridge=bridge interface=ether15 pvid=1002
add bridge=bridge interface=ether16 pvid=1002
add bridge=bridge interface=ether17 pvid=1003
add bridge=bridge interface=ether18 pvid=1003
add bridge=bridge interface=ether19 pvid=1003
add bridge=bridge interface=ether20 pvid=1003
add bridge=bridge interface=ether21 pvid=1003
add bridge=bridge interface=ether22 pvid=1003
add bridge=bridge interface=ether23 pvid=1003
add bridge=bridge interface=ether24 pvid=1003
add bridge=bridge interface=sfp-sfpplus1

Since the other switch will not have a WAN port, use these commands on SwitchB:

/interface bridge port
add bridge=bridge interface=ether1 pvid=1001
add bridge=bridge interface=ether2 pvid=1001
add bridge=bridge interface=ether3 pvid=1001
add bridge=bridge interface=ether4 pvid=1001
add bridge=bridge interface=ether5 pvid=1001
add bridge=bridge interface=ether6 pvid=1001
add bridge=bridge interface=ether7 pvid=1001
add bridge=bridge interface=ether8 pvid=1001
add bridge=bridge interface=ether9 pvid=1002
add bridge=bridge interface=ether10 pvid=1002
add bridge=bridge interface=ether11 pvid=1002
add bridge=bridge interface=ether12 pvid=1002
add bridge=bridge interface=ether13 pvid=1002
add bridge=bridge interface=ether14 pvid=1002
add bridge=bridge interface=ether15 pvid=1002
add bridge=bridge interface=ether16 pvid=1002
add bridge=bridge interface=ether17 pvid=1003
add bridge=bridge interface=ether18 pvid=1003
add bridge=bridge interface=ether19 pvid=1003
add bridge=bridge interface=ether20 pvid=1003
add bridge=bridge interface=ether21 pvid=1003
add bridge=bridge interface=ether22 pvid=1003
add bridge=bridge interface=ether23 pvid=1003
add bridge=bridge interface=ether24 pvid=1003
add bridge=bridge interface=sfp-sfpplus1
  • In case you are using a CRS1xx/CRS2xx series device:

All switches in this setup require that all used ports are switched together. Use these commands on SwitchA, SwitchB:

/interface bridge
add name=bridge vlan-filtering=no

There will be different ports assigned to each switch to a bridge since one switch will have a WAN port. Use these commands on SwitchA:

/interface bridge port
add bridge=bridge interface=ether2
add bridge=bridge interface=ether3
add bridge=bridge interface=ether4
add bridge=bridge interface=ether5
add bridge=bridge interface=ether6
add bridge=bridge interface=ether7
add bridge=bridge interface=ether8
add bridge=bridge interface=ether9
add bridge=bridge interface=ether10
add bridge=bridge interface=ether11
add bridge=bridge interface=ether12
add bridge=bridge interface=ether13
add bridge=bridge interface=ether14
add bridge=bridge interface=ether15
add bridge=bridge interface=ether16
add bridge=bridge interface=ether17
add bridge=bridge interface=ether18
add bridge=bridge interface=ether19
add bridge=bridge interface=ether20
add bridge=bridge interface=ether21
add bridge=bridge interface=ether22
add bridge=bridge interface=ether23
add bridge=bridge interface=ether24
add bridge=bridge interface=sfp-sfpplus1

Since the other switch will not have a WAN port, use these commands on SwitchB:

/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2
add bridge=bridge interface=ether3
add bridge=bridge interface=ether4
add bridge=bridge interface=ether5
add bridge=bridge interface=ether6
add bridge=bridge interface=ether7
add bridge=bridge interface=ether8
add bridge=bridge interface=ether9
add bridge=bridge interface=ether10
add bridge=bridge interface=ether11
add bridge=bridge interface=ether12
add bridge=bridge interface=ether13
add bridge=bridge interface=ether14
add bridge=bridge interface=ether15 
add bridge=bridge interface=ether16
add bridge=bridge interface=ether17
add bridge=bridge interface=ether18
add bridge=bridge interface=ether19
add bridge=bridge interface=ether20
add bridge=bridge interface=ether21
add bridge=bridge interface=ether22 
add bridge=bridge interface=ether23
add bridge=bridge interface=ether24
add bridge=bridge interface=sfp-sfpplus1

Disable the SFP2+ interface for security reasons (in case it is not being used):

/interface ethernet set [find where name="sfp-sfpplus2"] disabled=yes
Icon-note.png

Note: Create a bridge with VLAN filtering disabled at first. If you have misconfigured the VLAN table, you will not be able to access to switch. Enable VLAN filtering only on CRS3xx series devices and only when you have finished configuring VLANs.


Management port

There are multiple ways how to add a management port, in this example we will use a VLAN interface that accepts already tagged traffic with VLAN ID 99. We will allow management traffic only from ether3 and ether4 on both switches.

Icon-warn.png

Warning: Since a switch was never designed to be a router, then it will be required to have a firewall that blocks unwanted traffic that is destined to the switch. This must be kept in mind since it will be required to allow special packets such as DHCP to the switch that will have a DHCP Server since these packets will be sent to the CPU and they must not be blocked in the switch chip. If a firewall is not implemented, then management port is unneeded since access to the CPU will be granted either way. You can find an example firewall that will block unwanted traffic to the CPU. Keep in mind that each firewall rule will add extra load to the CPU.


For this guide we are going to use these addresses for each device:

Address Device
192.168.99.1 SwitchA
192.168.99.2 SwitchB

Use these commands on SwitchA:

/interface vlan
add interface=bridge name=MGMT vlan-id=99
/ip address
add address=192.168.99.1/24 interface=MGMT

And use these commands on SwitchB:

/interface vlan
add interface=bridge name=MGMT vlan-id=99
/ip address
add address=192.168.99.2/24 interface=MGMT
/ip route
add gateway=192.168.99.1
Icon-note.png

Note: SWitchB is a pure switch, it does not require a firewall to block unwanted traffic, this can be done in the switch chip instead and it is the preferred way on a switch.