Basic OSPF Setup Between Mikrotik and Cisco Router





Topology Diagram

R1>enable
R1#conf t
R1 (config)#hostname Ciscorouter1
Ciscorouter1 (config)#interface fastethernet 0/0
Ciscorouter1 (config-if)#ip address 192.168.1.1 255.255.255.252
Ciscorouter1 (config-if)#no shutdown
Ciscorouter1 (config-if)#exit
Ciscorouter1 (config)#interface loopback 1
Ciscorouter1 (config-if)#ip address 10.1.0.1 255.255.255.0
Ciscorouter1 (config-if)#no shutdown
Ciscorouter1 (config-if)#exit

Ciscorouter1 (config)#interface loopback 2
Ciscorouter1 (config-if)#ip address 10.2.0.1 255.255.255.0
Ciscorouter1 (config-if)#no shutdown
Ciscorouter1 (config-if)#exit
Ciscorouter1 (config)#interface loopback 3
Ciscorouter1 (config-if)#ip address 10.3.0.1 255.255.255.0
Ciscorouter1 (config-if)#no shutdown
Ciscorouter1 (config-if)#exit
Ciscorouter1 (config)#interface loopback 4
Ciscorouter1 (config-if)#ip address 192.168.100.1 255.255.255.255
Ciscorouter1 (config-if)#no shutdown
Ciscorouter1 (config-if)#exit
Ciscorouter1 (config)#router ospf 100
Ciscorouter1 (config-router)#network 10.0.0.0 0.255.255.255 area 0
Ciscorouter1 (config-router)#network 192.168.1.0 0.0.0.3 area 0
Ciscorouter1 (config-router)#network 192.168.100.1 0.0.0.0 area 0


Mikrotik Configuration:
[admin@MikroTik] > interface bridge add name=loopback1
[admin@MikroTik] > interface bridge add name=loopback2
[admin@MikroTik] > interface bridge add name=loopback3
[admin@MikroTik] > interface bridge add name=loopback4
[admin@MikroTik] > ip address add address=192.168.1.2/30 interface=ether1
[admin@MikroTik] > ip address add address=192.168.99.1/32 interface=loopback4
[admin@MikroTik] > ip address add address=172.16.30.1/24 interface=loopback3
[admin@MikroTik] > ip address add address=172.16.20.1/24 interface=loopback2
[admin@MikroTik] > ip address add address=172.16.10.1/24 interface=loopback1


OSPF Configuration
[admin@MikroTik] /routing ospf> interface add interface=all
[admin@MikroTik] /routing ospf> network add network=192.168.1.0/30 area=backbone
[admin@MikroTik] /routing ospf> network add network=192.168.99.1/32 area=backbone
[admin@MikroTik] /routing ospf> network add network=172.16.10.0/24 area=backbone
[admin@MikroTik] /routing ospf> network add network=172.16.20.0/24 area=backbone
[admin@MikroTik] /routing ospf> network add network=172.16.30.0/24 area=backbone


Mikrotik Router OSPF Verification:

[admin@MikroTik] > routing ospf neighbor print
 0 instance=default router-id=192.168.100.1 address=192.168.1.1
   interface=ether1 priority=1 dr-address=192.168.1.1
   backup-dr-address=192.168.1.2 state="Full" state-changes=5
   ls-retransmits=0 ls-requests=0 db-summaries=0 adjacency=7m59s

[admin@MikroTik] > routing ospf lsa print
AREA       TYPE         ID             ORIGINATOR     SEQUENCE-NU...   
backbone   router       192.168.100.1  192.168.100.1      0x80000006   
backbone   network      192.168.1.1    192.168.100.1      0x80000001

[admin@MikroTik] /ip route> print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 ADo  10.1.0.1/32                                         192.168.1.1                 110
 1 ADo  10.2.0.1/32                                         192.168.1.1                 110
 2 ADo  10.3.0.1/32                                         192.168.1.1                 110
 3 ADC  172.16.10.0/24     172.16.10.1           loopback1                    0
 4 ADC  172.16.20.0/24     172.16.20.1           loopback2                    0
 5 ADC  172.16.30.0/24     172.16.30.1           loopback3                    0
 6 ADC  192.168.1.0/30     192.168.1.2           ether1                           0
 7 ADC  192.168.99.1/32    192.168.99.1        loopback4                    0
 8 ADo  192.168.100.1/32                                192.168.1.1                110












[admin@MikroTik] > routing ospf route print
 # DST-ADDRESS        STATE          COST         GATEWAY         INTERFACE   
 0 10.1.0.1/32               intra-area          11                   192.168.1.1                 ether1      
 1 10.2.0.1/32               intra-area          11                   192.168.1.1                 ether1      
 2 10.3.0.1/32               intra-area          11                   192.168.1.1                 ether1      
 3 172.16.10.0/24         intra-area          10                   0.0.0.0                         loopback1   
 4 172.16.20.0/24         intra-area          10                   0.0.0.0                         loopback2   
 5 172.16.30.0/24         intra-area          10                   0.0.0.0                         loopback3   
 6 192.168.1.0/30         intra-area          10                   0.0.0.0                         ether1      
 7 192.168.99.1/32       intra-area          10                   0.0.0.0                          loopback4   
 8 192.168.100.1/32     intra-area          11                   192.168.1.1                  ether1



Cisco Router Verification:


Ciscorouter1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 3 subnets
O       172.16.30.0 [110/11] via 192.168.1.2, 00:14:03, FastEthernet0/0
O       172.16.20.0 [110/11] via 192.168.1.2, 00:14:03, FastEthernet0/0
O       172.16.10.0 [110/11] via 192.168.1.2, 00:14:03, FastEthernet0/0
     192.168.99.0/32 is subnetted, 1 subnets
O       192.168.99.1 [110/11] via 192.168.1.2, 00:14:03, FastEthernet0/0
     10.0.0.0/24 is subnetted, 3 subnets
C       10.2.0.0 is directly connected, Loopback2
C       10.3.0.0 is directly connected, Loopback3
C       10.1.0.0 is directly connected, Loopback1
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, FastEthernet0/0
     192.168.100.0/32 is subnetted, 1 subnets
C       192.168.100.1 is directly connected, Loopback4



Show ip route comment tell us about all directly connected routers and possible all path
To the destination. We see that our all route will exit the routing table.
Ciscorouter1#sh ip ospf neighbor

Neighbor ID     Pri   State           Dead Time     Address         Interface
192.168.1.2       1   FULL/BDR        00:00:37         192.168.1.2     FastEthernet0/0


Shown in the output we see that 192.168.1.2 is BDR state bcz Cisco Router have highest loopback interface and highest loopback interface also be win to DR election process.



Ciscorouter1#sh ip ospf database

            OSPF Router with ID (192.168.100.1) (Process ID 100)

                Router Link States (Area 0)

Link ID             ADV Router      Age         Seq#                        Checksum Link count
192.168.1.2         192.168.1.2     694         0x80000002                     0x00F7F7 5
192.168.100.1   192.168.100.1   698         0x80000008                     0x00ED8F 5

                Net Link States (Area 0)

Link ID            ADV Router      Age         Seq#       Checksum
192.168.1.1     192.168.100.1   698         0x80000001 0x006B5C