OSPFv3 for IPv4 Configuration

OSPF has seen quite some changes since it was introduced somewhere in the 1980s.

The first time it was documented was in 1989 in RFC 1131. Some improvements were made in OSPF version 2, first announced in RFC 1247, updated by RFC 1583, 2178 and 2328.

Later it was updated so it could support IPv6, this resulted in OSPFv3 which was described in RFC 2740, updated by RFC 5340.

Long story short…we used OSPF version 2 of IPv4 and OSPF version 3 for IPv6.

The IETF kept updating OSPF version 3 and since RFC 5838 it supports address families (just like BGP). This means we don’t have to run OSPFv2 and OSPFv3 next to each other, one routing instance supports IPv4 and IPv6 at the same time.

In this lesson, I’ll explain how to configure OSPFv3 for IPv4.

Configuration

OSPF has seen quite some changes since it was introduced somewhere in the 1980s. The first time it was documented was in 1989 in RFC 1131. Some improvements were made in OSPF version 2, first announced in RFC 1247, updated by RFC 1583, 2178 and 2328. Later it was updated so it could support IPv6, th


OSPFv3 with address family support has been added since IOS 15.1(3)S and 15.2(1)T. To demonstrate this I’ll use two routers:

OSPFV3 R1 R2

Let’s enable OSPFv3 on our routers:

R1(config)#router ospfv3 1
%OSPFv3: IPv6 routing not enabled

Even though I only want to configure routing for IPv4, OSPFv3 still uses IPv6 link-local addresses so we have to to enable IPv6:

R1 & R2
(config)#ipv6 unicast-routing

Now we’ll try to enable OSPFv3 on the interface:

R1 & R2
(config)#interface GigabitEthernet 3
(config-if)#ospfv3 1 ipv4 area 0

% OSPFv3: IPV6 is not enabled on this interface

If you don’t have IPv6 enable on your interfaces, you get the above error message. Let’s enable it:

R1 & R2
(config)#interface GigabitEthernet 3
(config-if)#ipv6 enable
(config-if)#ospfv3 1 ipv4 area 0

Once you enable IPv6 on the interface, a link-local address is created. The routers can now establish a neighbor adjacency. Let’s see if we can advertise something in OSPFv3:

R2(config)#interface loopback 0
R2(config)#ip address 2.2.2.2 255.255.255.0
R2(config-if)#ospfv3 1 ipv4 area 0       
     
% OSPFv3: IPV6 is not enabled on this interface

R2(config-if)#ipv6 enable 
R2(config-if)#ospfv3 1 ipv4 area 0

Above you can see I created a new loopback interface with an IP address, once I try to advertise it I still get en error that it requires an IPv6 address. This is a bit awkward since I won’t be using this interface to establish neighbor adjacencies, it’s only an IPv4 network that I want to advertise. Anyway, we enable IPv6 and then we can advertise it. Let’s verify our work:

Verification

First let’s check if we have neighbors:

R1#show ospfv3 neighbor 

          OSPFv3 1 address-family ipv4 (router-id 192.168.12.1)

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
192.168.12.2      1   FULL/DR         00:00:35    8               GigabitEthernet3

The output is the same as “show ip ospf neighbor” but now we use another command. Same thing applies to looking at the OSPF LSDB:

R1#show ospfv3 database 

          OSPFv3 1 address-family ipv4 (router-id 192.168.12.1)

		Router Link States (Area 0)

ADV Router       Age         Seq#        Fragment ID  Link count  Bits
 192.168.12.1    154         0x80000002  0            1           None
 192.168.12.2    155         0x80000002  0            1           None

		Net Link States (Area 0)

ADV Router       Age         Seq#        Link ID    Rtr count
 192.168.12.2    155         0x80000001  8          2

		Link (Type-8) Link States (Area 0)

ADV Router       Age         Seq#        Link ID    Interface
 192.168.12.1    198         0x80000001  8          Gi3
 192.168.12.2    195         0x80000001  8          Gi3

		Intra Area Prefix Link States (Area 0)

ADV Router       Age         Seq#        Link ID    Ref-lstype  Ref-LSID
 192.168.12.2    105         0x80000001  0          0x2001      0
 192.168.12.2    155         0x80000001  8192       0x2002      8

If you want to look at the OSPF entries in the routing table then the “old” command doesn’t work:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You've Ever Spent on Your Cisco Career!
  • Full Access to our 657 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

539 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags:


Forum Replies

  1. Hello Rene,

    Thanks for the good work here.
    Hope you will cover some of v5 written topics for OSPF (3.6 f&g) soon.

  2. Rene
    Great explanation but I have question about ipv6. I am new to ipv6. Since we are dealing with ipv6 and ospfv3.what I understand from the lesson ospf v3 deals with ipv6. Don’t we need to configure ipv6 address on the interfaces. You have configured ipv4 address
    Please let me know.

    Thanks
    Hamood

  3. Hamood,
    It used to be the case that OSPFv3 dealt exclusively with IPv6. The point of the lesson, however, is to show that this is no longer the case. OSPFv3 (via RFC 5838) now allows you to use it with both IPv4 and IPv6 via the concept of “address families.”

  4. Hello
    Could you help me know what exactly this command do ?

    (config-if)#ospfv3 1 ipv4 area 0

    Thank
    Sovandara

1 more reply! Ask a question or join the discussion by visiting our Community Forum