We are going to connect two parts of an OSPF area using OSPF Sham Link.
But OSPF process doesn’t install route into the routing table.
We can see an OSPF neighbor via the Sham Link:
[admin@R1] > /routing ospf neighbor print
0 instance=default router-id=10.0.4.2 address=10.0.0.4 interface=sham-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=1d5h48m41s
We can see 10.0.7.4/32 route in OSPF routing table
[admin@R1] > /routing ospf route print
# DST-ADDRESS STATE COST GATEWAY INTERFACE
0 10.0.7.1/32 intra-area 10 0.0.0.0 bridge2
1 10.0.7.4/32 intra-area 11 10.0.0.4 sham-link
We can see Stub network 10.0.7.4/32 in the OSPF LSA table
[admin@R1] > /routing ospf lsa print detail
instance=default area=backbone type=router id=10.0.0.1 originator=10.0.0.1 sequence-number=0x8000003D
age=1032 checksum=0x5961 options="E" body=
flags=
link-type=Point-To-Point id=10.0.4.2 data=10.0.0.1 metric=1
link-type=Stub id=10.0.7.1 data=255.255.255.255 metric=10
instance=default area=backbone type=router id=10.0.4.2 originator=10.0.4.2 sequence-number=0x8000003D
age=1047 checksum=0x3F70 options="E" body=
flags=
link-type=Point-To-Point id=10.0.0.1 data=10.0.0.4 metric=1
link-type=Stub id=10.0.7.4 data=255.255.255.255 metric=10
But we can’t see network 10.0.7.4/32 in main routing table:
[admin@R1] > /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 ADC 10.0.0.1/32 10.0.0.1 bridge1 0
1 A S 10.0.0.4/32 10.0.4.2 1
2 ADC 10.0.4.0/24 10.0.4.1 ether4 0
3 ADC 10.0.7.1/32 10.0.7.1 bridge2 0
We have two routers with similar and very simple configuration:
[admin@R1] > /export compact
# jan/01/2002 01:10:16 by RouterOS 6.20
...
/ip address
add address=10.0.4.1/24 interface=ether4 network=10.0.4.0
add address=10.0.0.1/32 interface=bridge1 network=10.0.0.1
add address=10.0.7.1/32 interface=bridge2 network=10.0.7.1
...
/ip route
add distance=1 dst-address=10.0.0.4/32 gateway=10.0.4.2
...
/routing ospf network
add area=backbone network=10.0.7.1/32
/routing ospf sham-link
add area=backbone cost=1 dst-address=10.0.0.4 src-address=10.0.0.1
...
/system identity
set name=R1
...
[admin@R4] > /export compact
# jan/01/2002 01:11:11 by RouterOS 6.20
...
/ip address
add address=10.0.4.2/24 interface=ether4 network=10.0.4.0
add address=10.0.0.4/32 interface=bridge1 network=10.0.0.4
add address=10.0.7.4/32 interface=bridge2 network=10.0.7.4
/ip route
add distance=1 dst-address=10.0.0.1/32 gateway=10.0.4.1
...
/routing ospf network
add area=backbone network=10.0.7.4/32
/routing ospf sham-link
add area=backbone cost=1 dst-address=10.0.0.1 src-address=10.0.0.4
...
/system identity
set name=R4
...