OSPF is enabled on each router interface.

With the exception of BGP, routing protocols such as OSPF and RIP/EIGRP are enabled on a per-router interface basis. Let’s consider “enabling OSPF on the interface” in detail.

When OSPF is enabled on the router’s interface, the following behavior is taking place.

  • Send and receive OSPF packets on the enabled interface
  • Register the enabled interface as an OSPF link in the LSDB

Send and receive OSPF packets on the enabled interface

OSPF packets will be sent on the enabled interface. The first step is to send a Hello packet.

Then, in order to receive OSPF packets, the interface is joined to the OSPF multicast address. 224.0.0.5 is a multicast group that represents all OSPF routers, and any interface with OSPF enabled will always join the 224.0.0.5 multicast group. If an OSPF enabled interface is elected as DR/BDR, it will also join the 224.0.0.6 multicast group.

Register the enabled interface as an OSPF link in the LSDB

The OSPF enabled interface will then be registered as an “OSPF link” in the LSA type 1 router LSA, which represents the state of the link for the router. LSAs will be exchanged with other OSPF routers. This means that the information of the OSPF enabled interface will be advertised to other OSPF routers. Note that information for interfaces that do not have OSPF enabled is not advertised.

Figure Behavior when OSPF is enabled on the interface
Figure Behavior when OSPF is enabled on the interface

Simple configuration of OSPF on a Cisco router

Let’s do a simple configuration of OSPF on R1 in the following figure and see what happens when OSPF is enabled on the interface.

Enable OSPF process

Before enabling OSPF on the interface, you need to enable the OSPF process; enable the OSPF process on R1 and set 1.1.1.1 as the router ID.

R1

router ospf 1
 router-id 1.1.1.1

Just by enabling the OSPF process, no OSPF link exists, so nothing will be registered in the LSDB.

R1

R1#show ip ospf database

            OSPF Router with ID (1.1.1.1) (Process ID 1)


Also, the interface of R1 is not participating in the OSPF multicast group.

Enable OSPF on Fa0/0

Enable OSPF on R1 Fa0/0.

R1

router ospf 1
 network 192.168.1.1 0.0.0.0 area 0

By enabling OSPF on R1 Fa0/0, Fa0/0 will join the multicast groups 224.0.0.5 and 224.0.0.6. There are no other routers connected to Fa0/0, but it is in DR, so it also participates in the 224.0.0.6 multicast group.

R1#show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Fa0/0        1     0               192.168.1.1/24     10    DR    0/0
R1#show ip interface FastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Internet address is 192.168.1.1/24
  Broadcast address is 255.255.255.255
  Address determined by setup command
  MTU is 1500 bytes
  Helper address is not set
  Directed broadcast forwarding is disabled
  Multicast reserved groups joined: 224.0.0.5 224.0.0.6
-- omitted --

And when you look at the LSDB, LSA type 1 for R1 is generated; the link count for LSA type 1 is 1.

R1

R1#show ip ospf database

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         273         0x80000001 0x00E4D1 1
R1#show ip ospf database router 1.1.1.1

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

  LS age: 281
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0xE4D1
  Length: 36
  Number of Links: 1

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.1.0
     (Link Data) Network Mask: 255.255.255.0
      Number of TOS metrics: 0
       TOS 0 Metrics: 10


Enable OSPF on Fa0/1

Next, enable OSPF on R1 Fa0/1.

R1

router ospf 1
 network 192.168.2.1 0.0.0.0 area 0

When OSPF is enabled on R1 Fa0/1, Fa0/1 participates in multicast groups 224.0.0.5 and 224.0.0.6.

R1

R1#show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Fa0/1        1     0               192.168.2.1/24     10    DR    0/0
Fa0/0        1     0               192.168.1.1/24     10    DR    0/0
R1#show ip interface FastEthernet 0/1
FastEthernet0/1 is up, line protocol is up
  Internet address is 192.168.2.1/24
  Broadcast address is 255.255.255.255
  Address determined by setup command
  MTU is 1500 bytes
  Helper address is not set
  Directed broadcast forwarding is disabled
  Multicast reserved groups joined: 224.0.0.5 224.0.0.6
~省略~

And the link count for LSA type 1 on R1 is 2. Fa0/1 link information has been added.

R1

R1#show ip ospf database

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         150         0x80000002 0x001917 2
R1#show ip ospf database router 1.1.1.1

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

  LS age: 157
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000002
  Checksum: 0x1917
  Length: 48
  Number of Links: 2

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.2.0
     (Link Data) Network Mask: 255.255.255.0
      Number of TOS metrics: 0
       TOS 0 Metrics: 10

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.1.0
     (Link Data) Network Mask: 255.255.255.0
      Number of TOS metrics: 0
       TOS 0 Metrics: 10


Summary

Point

  • Be properly aware that routing protocols such as OSPF should be “enabled on each router interface”.
  • When OSPF is enabled on the router interface, the following is done
    • Send and receive OSPF packets on the enabled interface
    • Register the enabled interface as an OSPF link in the LSDB

Related articles

How the OSPF works