Let’s start building the OSPF topology using basic OSPF configuration in a broadcast environment between R1, R2 and R3.
Configure OSPF area 0.
Make sure R1 is the DR router and R3 is the BDR.
Advertise Lo0 prefixes in area 0 and Lo1 prefixes (showing correct subnet mask)
Configure OSPF area 0 :
I’m using the network command to activate OSPF on all 3 routers :
router ospf 10 network 10.10.1.0 0.0.0.255 area 0
We can use different command to verify that OSPF is enable and that adjacencies is formed between the routers.
R1#sh ip ospf neigh Neighbor ID Pri State Dead Time Address Interface 126.96.36.199 1 FULL/DROTHER 00:00:34 10.10.1.2 Ethernet0/0 188.8.131.52 1 FULL/BDR 00:00:32 10.10.1.3 Ethernet0/0 R2#sh ip ospf int Ethernet0/0 is up, line protocol is up Internet Address 10.10.1.2/24, Area 0, Attached via Network Statement Process ID 10, Router ID 184.108.40.206, Network Type BROADCAST, Cost: 10 SNIP Neighbor Count is 2, Adjacent neighbor count is 2 Adjacent with neighbor 220.127.116.11 (Designated Router) Adjacent with neighbor 18.104.22.168 (Backup Designated Router)
Make sure R1 is the DR router and R3 is the BDR :
To get R1 as DR and R3 as BDR we need to set the ospf priority at te interface level.
On R2, I set the priority to 0 so it doens’t participate in DR/BDR election.
R1(config)#int Ethernet0/0 R1(config-if)#ip ospf priority 10 R2(config)#int Ethernet0/0 R2(config-if)#ip ospf priority 0 R3(config)#int Ethernet0/0 R3(config-if)#ip ospf prio 5
OSPF process needs to be restarted in order to perform a new election.
clear ip ospf proc Reset ALL OSPF processes? [no]:
Now we can see that R1 is the DR and R3 the BDR.
R1#sh ip ospf neigh det Neighbor 22.214.171.124, interface address 10.10.1.2 In the area 0 via interface Ethernet0/0 Neighbor priority is 0, State is FULL, 6 state changes DR is 10.10.1.1 BDR is 10.10.1.3 SNIP Neighbor 126.96.36.199, interface address 10.10.1.3 In the area 0 via interface Ethernet0/0 Neighbor priority is 5, State is FULL, 12 state changes DR is 10.10.1.1 BDR is 10.10.1.3
Advertise Lo0 prefixes in area 0 and Lo1 prefixes:
I’m using the interface level command to add the loopback into area 0.
To get the correct subnet mask for the Lo1, we need to change the network type to point-to-point.
int Loopback0 ip ospf 10 area 0 int Loopback1 ip ospf 10 area 0 ip ospf network point-to-point
When enabling OSPF on a loopback interface, the default network is « LOOPBACK ».
R1#sh ip ospf int Loopback0 is up, line protocol is up Internet Address 188.8.131.52/32, Area 0, Attached via Interface Enable Process ID 10, Router ID 184.108.40.206, Network Type LOOPBACK, Cost: 1 Enabled by interface config, including secondary ip addresses Loopback interface is treated as a stub Host Loopback1 is up, line protocol is up Internet Address 220.127.116.11/24, Area 0, Attached via Interface Enable Process ID 10, Router ID 18.104.22.168, Network Type POINT_TO_POINT, Cost: 1 Enabled by interface config, including secondary ip addresses Transmit Delay is 1 sec, State POINT_TO_POINT
When we verify the OSPF route received on R2, we can see that R1 and R3 Lo1 is showing a /24 subnet mask.
R2#sh ip route ospf 22.214.171.124/32 is subnetted, 1 subnets O 126.96.36.199 [110/11] via 10.10.1.1, 00:05:06, Ethernet0/0 188.8.131.52/32 is subnetted, 1 subnets O 184.108.40.206 [110/11] via 10.10.1.3, 00:03:55, Ethernet0/0 220.127.116.11/24 is subnetted, 1 subnets O 18.104.22.168 [110/11] via 10.10.1.1, 00:04:46, Ethernet0/0 22.214.171.124/24 is subnetted, 1 subnets O 126.96.36.199 [110/11] via 10.10.1.3, 00:03:55, Ethernet0/0
We have now fulfill all the requirements.
Thank you for reading.
OSPF – Building the topology – Basic OSPF configuration in broadcast environment