How to Configure OSPF Virtual Link on Mikrotik

 

in this tutorial we share how to configure OSPF Virtual Link on Mikrotik

R1 Configure

[admin@R1] > interface bridge add name=loopback0

[admin@R1] > ip address add address=10.10.10.10/32 interface=loopback0

[admin@R1] > ip address add address=172.16.200.1/30 interface=ether3

[admin@R1] > ip address add address=172.16.10.1/24 interface=ether2

[admin@R1] > routing ospf instance set router-id=10.10.10.10 name=default disabled
=no numbers=0
[admin@R1] >  routing ospf area set backbone disabled=no area-id=0.0.0.0
[admin@R1] > routing ospf network add network=192.168.20.0/30 area=backbone
[admin@R1] > routing ospf network add network=172.16.10.0/24 area=backbone
[admin@R1] > routing ospf network add network=172.16.200.0/30 area=backbone

R2 Configure

[admin@R2] > interface bridge add name=loopback0

[admin@R2] > ip address add address=9.9.9.9/32 interface=loopback0

[admin@R2] > ip address add address=172.16.200.2/30 interface=ether3

[admin@R2] > ip address add address=172.16.100.1/30 interface=ether2

[admin@R2] > routing ospf instance set router-id=9.9.9.9 name=default disabled=no
numbers=0
[admin@R2] > routing ospf area set backbone disabled=no area-id=0.0.0.0
[admin@R2] > routing ospf area add name=Area1 area-id=0.0.0.1 disabled=no
failure: duplicate item name
[admin@R2] > routing ospf area add name=Area1 area-id=0.0.0.1 disabled=no
[admin@R2] >  routing ospf virtual-link add neighbor-id=7.7.7.7 transit-area=Area1
disabled=no

R3 Configure

[admin@R3] > interface bridge add name=loopback0

[admin@R3] > ip address add address=7.7.7.7/32 interface=loopback0

[admin@R3] > ip address add address=172.16.200.1/30 interface=ether3

[admin@R3] > ip address add address=172.16.20.1/24 interface=ether2

[admin@R3] > routing ospf instance set router-id=7.7.7.7 name=default disabled=no
numbers=0=0
[admin@R3] > routing ospf area set backbone disabled=no area-id=0.0.0.0
[admin@R3] >  routing ospf area add name=Area1 area-id=0.0.0.1 disabled=no
[admin@R3] > routing ospf network add network=172.16.20.0/24 area=backbone
[admin@R3] > routing ospf network add network=172.16.100.0/30 area=Area1
[admin@R3] > routing ospf virtual-link add neighbor-id=9.9.9.9 transit-area=Area1
disabled=no

 

Verification

[admin@R1] > routing ospf neighbor print
0 instance=default router-id=9.9.9.9 address=172.16.200.2 interface=ether2
priority=1 dr-address=172.16.200.1 backup-dr-address=172.16.200.2
state=”Full” state-changes=4 ls-retransmits=0 ls-requests=0 db-summaries=0
adjacency=18m11s

[admin@R2] > routing ospf neighbor print
0 instance=default router-id=7.7.7.7 address=172.16.100.2 interface=virtual-link
priority=1 dr-address=0.0.0.0 backup-dr-address=0.0.0.0 state=”Full”
state-changes=4 ls-retransmits=0 ls-requests=0 db-summaries=0
adjacency=14m15s

1 instance=default router-id=7.7.7.7 address=172.16.100.2 interface=ether2
priority=1 dr-address=172.16.100.1 backup-dr-address=172.16.100.2
state=”Full” state-changes=4 ls-retransmits=0 ls-requests=0 db-summaries=0
adjacency=14m33s

2 instance=default router-id=10.10.10.10 address=172.16.200.1 interface=ether3
priority=1 dr-address=172.16.200.1 backup-dr-address=172.16.200.2
state=”Full” state-changes=6 ls-retransmits=0 ls-requests=0 db-summaries=0
adjacency=19m35s

[admin@R3] > routing ospf neighbor print
0 instance=default router-id=9.9.9.9 address=172.16.100.1 interface=virtual-link
priority=1 dr-address=0.0.0.0 backup-dr-address=0.0.0.0 state=”Full”
state-changes=5 ls-retransmits=0 ls-requests=0 db-summaries=0
adjacency=13m55s

1 instance=default router-id=9.9.9.9 address=172.16.100.1 interface=ether3
priority=1 dr-address=172.16.100.1 backup-dr-address=172.16.100.2
state=”Full” state-changes=6 ls-retransmits=0 ls-requests=0 db-summaries=0
adjacency=14m14s

[admin@R1] > routing ospf area-border-router print
# AREA            ROUTERID        STATE      GATEWAY         COST
0 backbone        7.7.7.7         intra-area 172.16.200.2    20
1 backbone        9.9.9.9         intra-area 172.16.200.2    10

 

[admin@R2] > routing ospf area-border-router print
# AREA             ROUTERID        STATE      GATEWAY         COST
0 backbone         7.7.7.7         intra-area                 10
1 backbone         9.9.9.9         intra-area                 0
2 Area1            7.7.7.7         intra-area 172.16.100.2    10
3 Area1            9.9.9.9         intra-area                 0

 

[admin@R3] > routing ospf area-border-router print
# AREA             ROUTERID        STATE      GATEWAY         COST
0 backbone         7.7.7.7         intra-area                 0
1 backbone         9.9.9.9         intra-area                 10
2 Area1            7.7.7.7         intra-area                 0
3 Area1            9.9.9.9         intra-area 172.16.100.1    10

 

 

 

 

 

 

 

Related posts

Leave a Comment