Categories R&S

OSPF – Building the topology – Basic OSPF configuration in broadcast environment

Let’s start building the  OSPF topology using basic OSPF configuration in a broadcast environment between R1, R2 and R3.

 

Requirements :

 

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)

 

 

Network diagram:

OSPF - basic OSPF

 

 Configuration:

 

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
22.22.22.22       1   FULL/DROTHER    00:00:34    10.10.1.2       Ethernet0/0
33.33.33.33       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 22.22.22.22, Network Type BROADCAST, Cost: 10
SNIP
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 11.11.11.11  (Designated Router)
    Adjacent with neighbor 33.33.33.33  (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.22.22.22, 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 33.33.33.33, 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 1.1.1.1/32, Area 0, Attached via Interface Enable
  Process ID 10, Router ID 11.11.11.11, 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 11.11.11.11/24, Area 0, Attached via Interface Enable
  Process ID 10, Router ID 11.11.11.11, 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
      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/11] via 10.10.1.1, 00:05:06, Ethernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/11] via 10.10.1.3, 00:03:55, Ethernet0/0
      11.0.0.0/24 is subnetted, 1 subnets
O        11.11.11.0 [110/11] via 10.10.1.1, 00:04:46, Ethernet0/0
      33.0.0.0/24 is subnetted, 1 subnets
O        33.33.33.0 [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