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.
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:
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 220.127.116.11 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:
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: