MikroTik OSPF Routing (Backbone).

The first thing is to assign their respective ips to the interfaces:

RA

1
2
3
4
5
/system identity set name=RA

/ip address
add interface=ether1 address=1.1.1.14/30
add interface=ether2 address=1.1.1.1/30

RB

1
2
3
4
5
/system identity set name=RB

/ip address
add interface=ether1 address=1.1.1.2/30
add interface=ether2 address=1.1.1.5/30

RC

1
2
3
4
5
/system identity set name=RC

/ip address
add interface=ether1 address=1.1.1.6/30
add interface=ether2 address=1.1.1.9/30

RD

1
2
3
4
5
/system identity set name=RD

/ip address
add interface=ether1 address=1.1.1.10/30
add interface=ether2 address=1.1.1.13/30

We’ll use virtual loopback (bridge) interfaces for this exercise. This makes the following steps work across any router model, regardless of how many ethernet ports it has. Running OSPF on a virtual interface also makes the protocol more stable, because that interface will always be online. The following commands create new bridge interfaces on all four of our routers:

RA

1
2
/interface bridge add name=loopback
/ip address add interface=loopback address=10.255.255.1/32

RB

1
2
/interface bridge add name=loopback
/ip address add interface=loopback address=10.255.255.2/32

RC

1
2
/interface bridge add name=loopback
/ip address add interface=loopback address=10.255.255.3/32

RD

1
2
/interface bridge add name=loopback
/ip address add interface=loopback address=10.255.255.4/32

OSPF Instance Configuration

We’ll configure the IP addresses created in the previous steps as the OSPF router’s ID. Use the following commands to configure the OSPF instances:

RA

1
/routing ospf instance set default router-id=10.255.255.1 redistribute-connected=as-type-1

RB

1
/routing ospf instance set default router-id=10.255.255.2 redistribute-connected=as-type-1

RC

1
/routing ospf instance set default router-id=10.255.255.3 redistribute-connected=as-type-1

RD

1
/routing ospf instance set default router-id=10.255.255.4 redistribute-connected=as-type-1

Advertising Networks

With our OSPF instances configured properly we can now begin advertising our connected networks. OSPF will advertise the following networks and addresses:

  • The interfaces
  • OSPF loopback
  • Point-to-point router links
  • LAN subnets

Use the following commands to advertise the routes directly connected on each router:

RA

1
2
3
4
5
6
7
/routing ospf interface
add interface=ether1 network-type=point-to-point
add interface=ether2 network-type=point-to-point

/routing ospf network
add network=1.1.1.0/30 area=backbone
add network=1.1.1.12/30 area=backbone

RB

1
2
3
4
5
6
7
/routing ospf interface
add interface=ether1 network-type=point-to-point
add interface=ether2 network-type=point-to-point

/routing ospf network
add network=1.1.1.0/30 area=backbone
add network=1.1.1.4/30 area=backbone

RC

1
2
3
4
5
6
7
/routing ospf interface
add interface=ether1 network-type=point-to-point
add interface=ether2 network-type=point-to-point

/routing ospf network
add network=1.1.1.4/30 area=backbone
add network=1.1.1.8/30 area=backbone

RD

1
2
3
4
5
6
7
/routing ospf interface
add interface=ether1 network-type=point-to-point
add interface=ether2 network-type=point-to-point

/routing ospf network
add network=1.1.1.8/30 area=backbone
add network=1.1.1.12/30 area=backbone

Enable DHCP server

Finally we create the dhcp server for lan and can access the routers

RD

1
2
3
4
5
6
7
8
9
10
11
12

/ip pool
add name=pool1 ranges=192.168.0.2-192.168.0.254

/ip dhcp-server
add address-pool=pool1 disabled=no interface=ether3 name=dhcp1

/ip address
add address=192.168.0.1/24 interface=ether3 network=192.168.0.0

/ip dhcp-server network
add address=192.168.0.0/24 gateway=192.168.0.1 netmask=24

Ip routes :
Traceroute

Traceroute

Exercise in gns3

Exercise in gns3

References

https://www.manitonetworks.com/networking/2018/6/21/mikrotik-ospf-routing

http://blog.e2h.net/2011/03/18/enrutamiento-ospf-en-routeros-de-mikrotik/

https://wiki.mikrotik.com/wiki/Manual:OSPF_Case_Studies#Stub_Area

© 2020 Juvenal Yescas All Rights Reserved.
Theme by hiero