Routers running OSPF exchange messages to convey routing information using five types of packets:
these packets are used to discover neighboring routers and also to exchange routing information to maintain accurate information about the network.
When OSPFv2 is enabled on the interface, R1 transitions from Down to Init and starts
sending OSPFv2 Hellos out of the interface in an attempt to discover neighbors.
When a R2 receives a hello from the previously unknown router R1, it adds R1’s router ID
to the neighbor list and responds with a Hello packet containing its own router ID.
R1 receives R2’s hello and notices that the message contains the R1 router ID in the list of R2’s neighbors.
R1 adds R2’s router ID to the neighbor list and transitions to the Two-Way State.
If R1 and R2 are connected with a point-to-point link, they transition to ExStart
If R1 and R2 are connected over a common Ethernet network, the DR/BDR election occurs.
The DR and BDR election occurs, where the router with the highest router ID or highest priority
is elected as the DR, and second highest is the BDR
After all LSRs have been exchanged and satisfied, the routers are considered synchronized and in a full state. Updates (LSUs) are sent:
The hierarchical-topology design options with multiarea OSPF can offer the following advantages.
R4
enable
conf t
router ospf 1
router-id 4.4.4.4
network 10.1.1.0 0.0.0.255 area 1
network 192.168.41.0 0.0.0.3 area 1
passive-interface g0/1
end
clear ip ospf processes
show ip route ospf
show ip ospf neighbor
show ip ospf interface g0/0
show ip protocol
show ip ospf database
R1
enable
conf t
router ospf 1
router-id 1.1.1.1
network 192.168.41.0 0.0.0.3 area 1
network 192.168.13.0 0.0.0.3 area 0
network 192.168.12.0 0.0.0.3 area 0
end
clear ip ospf processes
R2
enable
conf t
router ospf 1
router-id 2.2.2.2
network 192.168.32.0 0.0.0.3 area 0
network 192.168.12.0 0.0.0.3 area 0
network 192.168.25.0 0.0.0.3 area 2
area 2 virtual-link 5.5.5.5
end
clear ip ospf processes
R3
enable
conf t
router ospf 1
router-id 3.3.3.3
network 192.168.32.0 0.0.0.3 area 0
network 192.168.13.0 0.0.0.3 area 0
passive-interface g0/0
ip route 0.0.0.0 0.0.0.0 209.165.200.2
router ospf 1
default-information originate
R5
enable
conf t
router ospf 1
router-id 5.5.5.5
network 192.168.25.0 0.0.0.3 area 2
network 10.2.2.0 0.0.0.255 area 2
network 192.168.26.0 0.0.0.3 area 3
passive-interface g0/1
area 2 virtual-link 2.2.2.2
end
clear ip ospf processes
R6
enable
conf t
router ospf 1
router-id 6.6.6.6
network 192.168.26.0 0.0.0.3 area 3
end
show ip route
show ip route ospf
R4
enable
conf t
router ospf 1
router-id 4.4.4.4
interface g0/0
ip ospf 1 area 1
interface g0/1
ip ospf 1 area 1
R1
enable
conf t
router ospf 1
router-id 1.1.1.1
interface g0/0
ip ospf 1 area 1
interface s0/0/0
ip ospf 1 area 0
interface s0/0/1
ip ospf 1 area 0
R2
enable
conf t
router ospf 1
router-id 2.2.2.2
area 2 virtual-link 5.5.5.5
interface g0/0
ip ospf 1 area 2
interface s0/0/0
ip ospf 1 area 0
interface s0/0/1
ip ospf 1 area 0
R3
enable
conf t
router ospf 1
router-id 3.3.3.3
default-information originate
ip route 0.0.0.0 0.0.0.0 209.165.200.2
interface s0/0/0
ip ospf 1 area 0
interface s0/0/1
ip ospf 1 area 0
R5
enable
conf t
router ospf 1
router-id 5.5.5.5
area 2 virtual-link 2.2.2.2
interface g0/0
ip ospf 1 area 2
interface g0/1
ip ospf 1 area 2
interface s0/0/0
ip ospf 1 area 3
R6
enable
conf t
router ospf 1
router-id 6.6.6.6
interface s0/0/0
ip ospf 1 area 3