Page 1 of 1

OSPF second area

Posted: Thu Jun 17, 2021 6:05 pm
by wahrheitb
Hello everyone,

with GNS3 I have simulated a small network area that also causes problems on a large scale. the ROS version used is 6.48.3, which is the latest stable. The problem occurs when I set up a second OSPF area on the Mikrotik (CHR3). Then no more OSPF routes can be found via "ip route print", but the routes are still listed via "routing ospf lsa print". As soon as I remove the second area, the routes are back.

If I replace the Mikrotik with a Cisco, the problem does not exist and everything works.
network.png
Here the configs.

CHR1
/routing ospf instance
set [ find default=yes ] distribute-default=if-installed-as-type-1 \
    redistribute-connected=as-type-1
/ip address
add address=10.0.0.1/30 interface=ether2 network=10.0.0.0
/ip dhcp-client
add !dhcp-options disabled=no interface=ether1
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
/routing ospf network
add area=backbone network=10.0.0.0/30
/system identity
set name=CHR1

CHR2
/routing ospf area
add area-id=0.0.0.10 name=area10
/routing ospf instance
set [ find default=yes ] distribute-default=if-installed-as-type-1 \
    redistribute-connected=as-type-1 router-id=10.0.0.2
/ip address
add address=10.0.0.2/30 interface=ether1 network=10.0.0.0
add address=10.10.0.1/24 interface=ether2 network=10.10.0.0
/routing ospf network
add area=backbone network=10.0.0.0/30
add area=area10 network=10.10.0.0/24
/routing ospf virtual-link
add neighbor-id=10.10.0.6 transit-area=area10
/system identity
set name=CHR2

CHR3
/routing ospf area
add area-id=0.0.0.10 name=area10
add area-id=0.0.0.20 name=area20
/routing ospf instance
set [ find default=yes ] redistribute-connected=as-type-1 router-id=10.10.0.6
/ip address
add address=10.10.0.6/24 interface=ether1 network=10.10.0.0
add address=5.5.5.5/24 interface=ether2 network=5.5.5.0
/routing ospf network
add area=area10 network=10.10.0.0/24
add area=area20 network=5.5.5.0/24 # when is removed then i can see the OSPF routes "ip route print" 
/routing ospf virtual-link
add neighbor-id=10.0.0.2 transit-area=area10
/system identity
set name=CHR3

CHR4
/routing ospf area
add area-id=0.0.0.20 name=area20
set [ find default=yes ] redistribute-connected=as-type-1
/ip address
add address=5.5.5.1/24 interface=ether1 network=5.5.5.0
/routing ospf network
add area=area20 network=5.5.5.0/24
/system identity
set name=CHR4

here an screenshot with
With second Network.png
and without the OSPF network entry
without second Network.png

Re: OSPF second area

Posted: Fri Jun 18, 2021 5:49 am
by JJT211
On all routers set

redistribute-connected=no

Im new to OSPF but I believe in most cases, you should only distribute routes by the network tab. Leave everything set to no with the exception of the default route

CHR1 for example, should look like this
/routing ospf instance
set [ find default=yes ] distribute-default=if-installed-as-type-1
/ip address
add address=10.0.0.1/30 interface=ether2 network=10.0.0.0
/ip dhcp-client
add !dhcp-options disabled=no interface=ether1
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
/routing ospf network
add area=backbone network=10.0.0.0/30
/system identity
set name=CHR1

Re: OSPF second area

Posted: Wed Jul 14, 2021 6:26 am
by millenium7
What you are posting violates the operational rules of OSPF and will not work properly
OSPF requires all area's to directly connect to the backbone/Area0
In your example, area 20 is not connected to area 0

You can bend this rule with 'virtual links' to form a tunnel between area0 and area20, however this is not recommended and will not result in the type of traffic flow you would logically expect
In order for area20 to talk to area10 for instance, it will traverse Area20->Area0->Area10

......... Yes OSPF design absolutely sucks in many networks
There are valid reasons behind its design concepts, but the simple reality is they don't fit all networks, period. Despite what some rigid people seem to think
The 'best' solution (i'd argue 'totally shit', but you have to work within the design boundaries) is to simply not use different area's whatsoever. Leave everything in Area0, otherwise it causes issues with things like MPLS/VPLS and becomes an administrative nightmare if a sectioned off area starts to grow beyond what you think, or you need redundant paths that lead back to Area0 (maybe through another area like you've created a ring network) yada yada yada

There are networks with 500+ routers all in a single backbone area and it works. Is it ideal? not at all, but its the lesser evil