Mikrotik Multi Area OSPF Configuration
Mikrotik multi area ospf configuration is a skill that must be known and used to conserve processor utilization on Mikrotik routers. One of the selling points of Mikrotik is the availability of advance features on all product lines; even on the smallest Mikrotik router you can get your hands on.
Features like MPLS, OSPF, IPSEC, etc. are available even on the smallest of all Mikrotik routers. However, this selling point, if not properly managed, can cause a tremendous overhead on the router’s processor, especially on the RB750 and RB950 product lines.
In this post, we will look at how to implement Mikrotik multi area ospf with route summarization on area border routers (ABRs). We will use a 5-router topology to connect area one networks over the backbone area (area zero). Routers MR1 and MR3 are the ABR routers with interfaces in area 0 and area 1. Networks 192.168.1.0/24 is advertised into area 1 while 192.168.2.0/24 is advertised in area 2. Both networks will be summarized on their respective ABRs as they are being advertised into area 0.
Mikrotik multi area ospf configuration
At this point I will assume that all IP address assignments have been done and the goal is to achieve inter-network connectivity while reducing the routing table entries and overheads on the router’s processor. There are five routers in my topology. They are named MR1 to MR5. MR2 will have its two interfaces in area 0. MR1 will have one interface in area 0 and the other interface in area 1. MR3 will have one interface in area 0 and the other interface in area 2. On MR4 and MR5 all interfaces are in areas 1 and 2 respectively.
MR2 OSPF Configuration
Firstly, configure ospf on router MR2 since it represents the core of the network topology. There are basically three steps to enabling ospf on a Mikrotik router: create an ospf instance, creat an ospf area, and enable ospf on an interface. See commands below.
routing ospf instance add name=ospf-instance-1 version=2 vrf=main router-id=main routing ospf area add name="ospf-area-0" instance=ospf-instance-1 area-id=0.0.0.0 type=default routing ospf interface-template add area=ospf-area-0 interfaces=ether1 instance-id=0 type=ptp routing ospf interface-template add area=ospf-area-0 interfaces=ether2 instance-id=0 type=ptp
MR1 and MR3 OSPF Configuration
Both devices have similar job roles, therefore, their ospf configuration will almost be the same, save for the areas and summary addresses. MR1 will summarize 192.168.1.0/24 while MR3 will summarize 192.168.2.0/24. Since both routers are ABRs, there will be two areas on each of them and interfaces will be assigned to their respective areas. I will use the configuration of MR1 to represent both devices. See command below.
routing ospf instance add name=ospf-instance-1 version=2 vrf=main router-id=main routing ospf area add name="ospf-area-0" instance=ospf-instance-1 area-id=0.0.0.0 type=default routing ospf area add name="ospf-area-1" instance=ospf-instance-1 area-id=0.0.0.1 type=default routing ospf interface-template add area=ospf-area-0 interfaces=ether1 instance-id=0 type=ptp routing ospf interface-template add area=ospf-area-1 interfaces=ether2 instance-id=0 type=ptp routing ospf area range add prefix=192.168.1.0/24 area=0
MR4 and MR5 OSPF Configuration
MR4 and MR5 are in areas 1 and 2 respectively. See commands below
routing ospf instance add name=ospf-instance-1 version=2 vrf=main router-id=main routing ospf area add name="ospf-area-1" instance=ospf-instance-1 area-id=0.0.0.1 type=default routing ospf interface-template add area=ospf-area-1 interfaces=ether1 instance-id=0 type=ptp
Routing table and reachability Verification
Now that the configuration requirements have been met, let’s see the routing entries on MR5 and confirm that all routes are present in the routing table. See output below.
[[email protected]] > ip add pr Flags: D - DYNAMIC Columns: ADDRESS, NETWORK, INTERFACE # ADDRESS NETWORK INTERFACE 0 192.168.2.2/24 192.168.2.0 ether1 1 D 192.168.220.133/24 192.168.220.0 ether2 [[email protected]] > ip rout pr Flags: D - DYNAMIC; A - ACTIVE; c, s, o, y - COPY Columns: DST-ADDRESS, GATEWAY, DISTANCE # DST-ADDRESS GATEWAY DISTANCE DAo 126.96.36.199/30 192.168.2.1%ether1 110 DAo 188.8.131.52/30 192.168.2.1%ether1 110 DAo 192.168.1.0/24 192.168.2.1%ether1 110 DAc 192.168.2.0/24 ether1 0 DAc 192.168.220.0/24 ether2 0 0 s 192.168.220.0/24 192.168.2.1 1 [[email protected]] > [[email protected]] > [[email protected]] > ping 192.168.1.2 SEQ HOST SIZE TTL TIME STATUS 0 192.168.1.2 56 61 2ms758us 1 192.168.1.2 56 61 2ms448us 2 192.168.1.2 56 61 2ms403us 3 192.168.1.2 56 61 3ms69us 4 192.168.1.2 56 61 3ms61us 5 192.168.1.2 56 61 3ms278us sent=6 received=6 packet-loss=0% min-rtt=2ms403us avg-rtt=2ms836us max-rtt=3ms278us
The output above confirms route advertisement and reachability from MR5 to MR4. Thank you for reading.
If you enjoyed this tutorial, please subscribe to this blog to receive my posts via email. Also subscribe to my YouTube channel, like my Facebook page and follow me on Twitter.