Single Area OSPF Step by Step on Mikrotik RouterOS 7

OSPF is the most common dynamic routing protocol used on internal networks, also known as Autonomous Systems (AS).


Why do we need OSPF?

There are several reasons. We use OSPF to dynamically build the routing table by exchanging OSPF messages inside the routing domain.


Our Topology



Our Process

  1. Create instance and related objects

  2. Create a loopback interface (interface bridge add name=loopback)

  3. Assign the IP address to the loopback interface ( /ip address add address=10.R.R.R interface=loopback)

  4. Create a Router-ID: /routing id add disabled=no id=10.R.R.R name=id-1

  5. Create OSPF Instance /routing ospf instance add name=ospf-instance-1 router-id=id-1

  6. Create Area /routing ospf area add instance=ospf-instance-1 area-id=0.0.0.0 name=backbone

  7. Create interface template /routing ospf interface-template add area=backbone auth=md5 auth-key=SECRET interfaces=INTERFACE/ALL type=NETWORK_TYPE

  8. Verify and Test


Video Tutorial Step by Step

Follow my YouTube video, and I will show you step by step how to configure a single area OSPF topology



Configuration Backups


R-1 Configuration


/interface bridge
add name=loopback
/routing id
add disabled=no id=10.1.1.1 name=id-1 select-dynamic-id=""
/routing ospf instance
add name=ospf-instance-1 originate-default=if-installed router-id=id-1
/routing ospf area
add instance=ospf-instance-1 name=backbone
/ip address
add address=10.1.3.1/24 interface=ether1 network=10.1.3.0
add address=10.2.3.1/24 interface=ether2 network=10.2.3.0
add address=192.168.1.1/24 interface=ether3 network=192.168.1.0
add address=10.1.1.1 interface=loopback network=10.1.1.1
/ip dhcp-client
add interface=ether4 comment="WAN/Mgmt Network"
/routing ospf interface-template
add area=backbone auth=md5 auth-key=mikrotik interfaces=ether1 type=ptp
add area=backbone auth=md5 auth-key=mikrotik interfaces=ether2
add area=backbone interfaces=all passive
/system identity
set name=R-1

R-2 Configuration



/interface bridge
add name=loopback
/routing id
add disabled=no id=10.2.2.2 name=id-1 select-dynamic-id=""
/routing ospf instance
add name=ospf-instance-1 router-id=id-1
/routing ospf area
add instance=ospf-instance-1 name=backbone
/ip address
add address=10.3.2.2/24 interface=ether1 network=10.3.2.0
add address=10.2.3.2/24 interface=ether2 network=10.2.3.0
add address=192.168.2.1/24 interface=ether3 network=192.168.2.0
add address=10.2.2.2 interface=loopback network=10.2.2.2
/routing ospf interface-template
add area=backbone auth=md5 auth-key=mikrotik interfaces=ether1 type=ptp
add area=backbone auth=md5 auth-key=mikrotik interfaces=ether2
add area=backbone interfaces=all passive
/system identity
set name=R-2

R-3 Configuration

/interface bridge
add name=loopback
/routing id
add disabled=no id=10.3.3.3 name=id-1 select-dynamic-id=""
/routing ospf instance
add name=ospf-instance-1 router-id=id-1
/routing ospf area
add instance=ospf-instance-1 name=backbone
/ip address
add address=10.1.3.3/24 interface=ether1 network=10.1.3.0
add address=10.3.2.3/24 interface=ether2 network=10.3.2.0
add address=192.168.3.1/24 interface=ether3 network=192.168.3.0
add address=10.3.3.3 interface=loopback network=10.3.3.3
/routing ospf interface-template
add area=backbone auth=md5 auth-key=mikrotik interfaces=ether1,ether2 type=ptp
add area=backbone interfaces=all passive
/system identity
set name=R-3

R-4 Configuration

/interface bridge
add name=loopback
/routing id
add disabled=no id=10.4.4.4 name=id-1 select-dynamic-id=""
/routing ospf instance
add name=ospf-instance-1 router-id=id-1
/routing ospf area
add instance=ospf-instance-1 name=backbone
/ip address
add address=10.2.3.4/24 interface=ether1 network=10.2.3.0
add address=192.168.4.1/24 interface=ether2 network=192.168.4.0
add address=10.4.4.4 interface=loopback network=10.4.4.4
/routing ospf interface-template
add area=backbone auth=md5 auth-key=mikrotik interfaces=ether1
add area=backbone interfaces=all passive
/system identity
set name=R-4


Author: Wilmer Almazan / The Network Trip (Jan 2022) My YouTube Channel: https://www.youtube.com/channel/c/TheNetworkTrip

470 views1 comment