How to configure mikrotik network equipment » History » Version 27
  Nico Schottelius, 07/28/2020 03:20 PM 
  
| 1 | 1 | Nico Schottelius | h1. How to configure mikrotik network equipment  | 
|---|---|---|---|
| 2 | |||
| 3 | 6 | Nico Schottelius | {{toc}} | 
| 4 | 1 | Nico Schottelius | |
| 5 | h2. Status  | 
||
| 6 | |||
| 7 | This document is **PRE PRODUCTION**.  | 
||
| 8 | |||
| 9 | 27 | Nico Schottelius | h2. Finding a directly connected Mikrotik switch  | 
| 10 | |||
| 11 | If you don't know the IP address of a Mikrotik switch, just connect a direct cable to it and ping the IPv6 multicast all nodes address:  | 
||
| 12 | |||
| 13 | <pre>  | 
||
| 14 | 5: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000  | 
||
| 15 | link/ether 80:1f:02:d6:4c:50 brd ff:ff:ff:ff:ff:ff  | 
||
| 16 | inet6 fe80::821f:2ff:fed6:4c50/64 scope link  | 
||
| 17 | valid_lft forever preferred_lft forever  | 
||
| 18 | bridge:~# ping ff02::1%eth1  | 
||
| 19 | PING ff02::1%eth1 (ff02::1%5): 56 data bytes  | 
||
| 20 | 64 bytes from fe80::821f:2ff:fed6:4c50: seq=0 ttl=64 time=0.115 ms  | 
||
| 21 | 64 bytes from fe80::c6ad:34ff:fe88:832b: seq=0 ttl=64 time=0.588 ms (DUP!)  | 
||
| 22 | 64 bytes from fe80::821f:2ff:fed6:4c50: seq=1 ttl=64 time=0.109 ms  | 
||
| 23 | 64 bytes from fe80::c6ad:34ff:fe88:832b: seq=1 ttl=64 time=0.432 ms (DUP!)  | 
||
| 24 | ^C  | 
||
| 25 | --- ff02::1%eth1 ping statistics ---  | 
||
| 26 | 2 packets transmitted, 2 packets received, 2 duplicates, 0% packet loss  | 
||
| 27 | round-trip min/avg/max = 0.109/0.311/0.588 ms  | 
||
| 28 | bridge:~#  | 
||
| 29 | </pre>  | 
||
| 30 | |||
| 31 | * One of the ip address is you, the other one is the switch  | 
||
| 32 | |||
| 33 | 1 | Nico Schottelius | h2. Setting up a newly arrived Mikrotik switch  | 
| 34 | |||
| 35 | This part is specific for mikrotik-crs326 devices and should  | 
||
| 36 | |||
| 37 | After arriving within 1 work day do:  | 
||
| 38 | |||
| 39 | * Unpack  | 
||
| 40 | * Find out which name the switch should have  | 
||
| 41 | ** go to https://netbox.ungleich.ch  | 
||
| 42 | ** search for crs326  | 
||
| 43 | ** identify the last used number  | 
||
| 44 | ** Create a new device  | 
||
| 45 | *** go to devices  | 
||
| 46 | *** devices  | 
||
| 47 | *** add  | 
||
| 48 | **** name: "mikrotik-crs326-XX"  | 
||
| 49 | **** device-role: a device role  | 
||
| 50 | **** device-type: CRS326  | 
||
| 51 | **** serial-number: <from the device>  | 
||
| 52 | **** site: placeX -  | 
||
| 53 | **** create  | 
||
| 54 | * Add a physical label with its name  | 
||
| 55 | ** Do not continue before you have done that!  | 
||
| 56 | * configure your notebook with the ipv4 address 192.168.88.23/24  | 
||
| 57 | * connect to the crs326: @ssh admin@192.168.88.1@  | 
||
| 58 | * Configure the switch  | 
||
| 59 | ** Set identity: @/system identity set name=mikrotik-crs326-XX@ # use the correct name  | 
||
| 60 | ** Set password: @/user set admin password=@ # use the password for mikrotik in the place that you are, use password store  | 
||
| 61 | ** Enable IPv6: @/system package enable ipv6@  | 
||
| 62 | ** Reboot so that IPv6 is enabled: @/system reboot@  | 
||
| 63 | 2 | Nico Schottelius | ** Add a place indendent, unrouted IPv6 address: @/ipv6 address add eui-64=yes advertise=no interface=bridge address=2a0a:e5c0:1:c::/64@  | 
| 64 | ** Get the assigned IPv6 address: @/ipv6 address print@  | 
||
| 65 | ** Disconnect from the switch  | 
||
| 66 | * Assign your notebook the IPv6 address *2a0a:e5c0:1:c::23/64*  | 
||
| 67 | 1 | Nico Schottelius | * Connect to the switch via IPv6  | 
| 68 | 3 | Nico Schottelius | ** Remove the IPv4 address 192.168.88.1 to avoid collisions with other switches: @/ip address remove numbers=0@  | 
| 69 | *** Verify: @/ip address print@  | 
||
| 70 | * Verify / update entries in netbox:  | 
||
| 71 | ** Verify that the serial number is correct: @:put [ /system routerboard get serial-number ]@  | 
||
| 72 | 4 | Nico Schottelius | ** Netbox  | 
| 73 | *** go to the ipv6 prefix https://netbox.ungleich.ch/ipam/prefixes/216/  | 
||
| 74 | **** create a new ipv6 address  | 
||
| 75 | **** set the DNS name to *mikrotik-crs326-XX*  | 
||
| 76 | 5 | Nico Schottelius | **** role = loopback  | 
| 77 | 6 | Nico Schottelius | * Ensure all steps are taken correctly  | 
| 78 | * Move the device to our inventory / stock if not directly used  | 
||
| 79 | 7 | Nico Schottelius | |
| 80 | |||
| 81 | h2. Configuring a Mikrotik switch for integration into the network  | 
||
| 82 | |||
| 83 | Depending on the usage scenario, we will define a variety of bridges and assign ports to it.  | 
||
| 84 | |||
| 85 | * In almost all cases the uplink port will be the *sfp-sfpplus1* port.  | 
||
| 86 | * In almost all cases we want to apply vlan tagging to that port  | 
||
| 87 | * For server networks, we configure the MTU to the highest value the switch supports  | 
||
| 88 | ** Devices are configured with a 9200 MTU  | 
||
| 89 | ** So the MTU on the switch ports needs to be at least 9200  | 
||
| 90 | |||
| 91 | h3. First step for all integrations  | 
||
| 92 | |||
| 93 | 8 | Nico Schottelius | Setup MTU of all *sfp-sfpplus* ports (plural) to 9200 and the L2MTU to 9204:  | 
| 94 | 1 | Nico Schottelius | |
| 95 | 8 | Nico Schottelius | Use @/interface print@ to find out the maximum MTU:  | 
| 96 | |||
| 97 | <pre>  | 
||
| 98 | [admin@mikrotik-crs326-1] > /interface print  | 
||
| 99 | Flags: D - dynamic, X - disabled, R - running, S - slave  | 
||
| 100 | # NAME TYPE ACTUAL-MTU L2MTU MAX-L2MTU MAC-ADDRESS  | 
||
| 101 | 0 S ether1 ether 9200 9204 10218 B8:69:F4:8E:AC:BA  | 
||
| 102 | 1 S ether2 ether 9200 9204 10218 B8:69:F4:8E:AC:BB  | 
||
| 103 | ...  | 
||
| 104 | 24 R sfp-sfpplus1 ether 9200 9204 10218 B8:69:F4:8E:AC:D2  | 
||
| 105 | 25 sfp-sfpplus2 ether 9200 9204 10218 B8:69:F4:8E:AC:D3  | 
||
| 106 | </pre>  | 
||
| 107 | |||
| 108 | Above is already setup, but the values differ, use the following to set it correctly:  | 
||
| 109 | |||
| 110 | <pre>  | 
||
| 111 | /interface set sfp-sfpplus1 mtu=9200 l2mtu=9204  | 
||
| 112 | /interface set sfp-sfpplus2 mtu=9200 l2mtu=9204  | 
||
| 113 | </pre>  | 
||
| 114 | |||
| 115 | 7 | Nico Schottelius | h3. Use case 1: coworking network  | 
| 116 | 1 | Nico Schottelius | |
| 117 | 9 | Nico Schottelius | To use the switch in a coworking network, we keep the MTU  | 
| 118 | |||
| 119 | 16 | Samuel Hailu | * Create a vlan interface named *vlan-coworking*: @/interface vlan add vlan-id=15 name=vlan-coworking interface=sfp-sfpplus1@  | 
| 120 | ** Verify that it is created: @/interface vlan print@  | 
||
| 121 | 1 | Nico Schottelius | ** Lookup the vlan-id from https://netbox.ungleich.ch/ipam/vlans/  | 
| 122 | 9 | Nico Schottelius | ** The vlan will be added to *sfp-sfpplus1*  | 
| 123 | 16 | Samuel Hailu | * Create a bridge named *bridge-coworking*: @/interface bridge add name=bridge-coworking@  | 
| 124 | ** Verify that it is created: @/interface print@  | 
||
| 125 | * Add the interface *vlan-coworking* to the *bridge-coworking* as a port: @/interface vlan add interface=vlan-coworking@  | 
||
| 126 | ** Verify that the port is added: @/interface vlan print@  | 
||
| 127 | 15 | Nico Schottelius | * Add all ethernet ports that you need for coworking to the *bridge-coworking*  | 
| 128 | 16 | Samuel Hailu | ** For instance to add port 7: @/interface bridge port set bridge=bridge-coworking numbers=6@  | 
| 129 | *** Find the number of the interface with @/interface bridge port print@  | 
||
| 130 | 15 | Nico Schottelius | ** Verify again like you did above  | 
| 131 | 8 | Nico Schottelius | |
| 132 | 17 | Nico Schottelius | h3. Use case 2: server or internal network  | 
| 133 | |||
| 134 | Steps similar to above, BUT ensure that the MTU is set correctly on all interfaces.  | 
||
| 135 | |||
| 136 | * Ensure that the mtu is correct on the *sfp-sfplus* interfaces (see above)  | 
||
| 137 | ** This is important  | 
||
| 138 | * We create a bridge named  | 
||
| 139 | 20 | Samuel Hailu | ** *bridge-server*: @/interface bridge add name=bridge-server@  | 
| 140 | ** *bridge-internal*: @/interface bridge add name=bridge-internal@  | 
||
| 141 | 17 | Nico Schottelius | * We create a new vlan interface on *sfp-sfpplus1* named  | 
| 142 | 21 | Samuel Hailu | ** *vlan-server*: @/interface vlan add name=vlan-server interface=sfp-sfpplus1 mtu=9200@  | 
| 143 | 22 | Samuel Hailu | ** *vlan-internal*: @/interface vlan add name=vlan-internal interface=sfp-sfpplus1 mtu=9200@  | 
| 144 | 17 | Nico Schottelius | * Add the  | 
| 145 | 20 | Samuel Hailu | ** *vlan-server* interface as a port to *bridge-server*: @/interface bridge port add interface=vlan-server bridge=bridge-server@  | 
| 146 | ** *vlan-internal* interface as a port to *bridge-internal*: @/interface bridge port add interface=vlan-internal bridge=bridge-internal@  | 
||
| 147 | 17 | Nico Schottelius | * Verify that the MTU is correct  | 
| 148 | 23 | Nico Schottelius | ** On the VLAN interface: @/interface vlan print@  | 
| 149 | ** On the bridge: @/interface bridge print@  | 
||
| 150 | ** On the sfp-sfpplus interfaces: @/interface print@  | 
||
| 151 | 17 | Nico Schottelius | |
| 152 | |||
| 153 | 19 | Nico Schottelius | <pre>  | 
| 154 | If the MTUs are wrong, you can encounter hanging connections, while ping (small packet) still works. Be careful to do it right.  | 
||
| 155 | </pre>  | 
||
| 156 | 17 | Nico Schottelius | |
| 157 | 25 | Nico Schottelius | h2. Typical setup for a new mikrotik-crs326 in place6  | 
| 158 | |||
| 159 | You need to insert a GBIC module *BEFORE* seting mtu on the sfp-sfpplus interface  | 
||
| 160 | |||
| 161 | <pre>  | 
||
| 162 | /interface set sfp-sfpplus1 mtu=10216 l2mtu=10218  | 
||
| 163 | |||
| 164 | /interface bridge add name=bridge-server  | 
||
| 165 | /interface vlan add name=vlan-server interface=sfp-sfpplus1 mtu=10214 vlan-id=11  | 
||
| 166 | /interface bridge port add interface=vlan-server bridge=bridge-server  | 
||
| 167 | |||
| 168 | /interface bridge add name=bridge-internal  | 
||
| 169 | /interface vlan add name=vlan-internal interface=sfp-sfpplus1 mtu=10214 vlan-id=10  | 
||
| 170 | /interface bridge port add interface=vlan-internal bridge=bridge-internal  | 
||
| 171 | |||
| 172 | 26 | Nico Schottelius | /ipv6 address add eui-64=yes advertise=no interface=bridge-internal address=2a0a:e5c0:2::/64  | 
| 173 | /ipv6 address print  | 
||
| 174 | 25 | Nico Schottelius | |
| 175 | 26 | Nico Schottelius | </pre>  | 
| 176 | 25 | Nico Schottelius | |
| 177 | 8 | Nico Schottelius | h2. Update the switch to the latest version  | 
| 178 | |||
| 179 | (TBD for IPv6 only networks)  |