OSPFv3 Configuration on Cisco Routers for IPv6
Hi. In this post, we will configure OSPFv3 for routing on Cisco routers when using IPv6 and set up IPv6 distribution using DHCPv6.
First, what is OSPFv3, and what are the differences between version 1 and version 2?
OSPFv3 is a dynamic routing protocol developed for IPv6 networks. It is the third version of OSPF and an improved version of the OSPFv2 protocol used for IPv4. OSPFv3 operates as a link-state routing protocol and uses the same algorithm (Dijkstra). Its most significant difference is its support for IPv6, but it also includes additional features and improvements.
Differences Between OSPFv1, v2, and v3
Protocol Support
- OSPFv1: The first version, but no longer used.
- OSPFv2: Supports IPv4 networks and is widely used.
- OSPFv3: Designed to support IPv6 but can also handle IPv4 routing (RFC 5838).
IP Addresses and Links
- OSPFv2: Uses IPv4 addresses and is based on IP addresses for routing.
- OSPFv3: Uses IPv6 addresses. However, it relies on link-local addresses instead of IP addresses for communication on router links.
Packet Format
- OSPFv2: Has a packet format specific to IPv4.
- OSPFv3: The packet format has been redesigned to be more flexible, with some headers changed for IPv6 compatibility.
Authentication
- OSPFv2: Includes MD5 or password-based authentication. Authentication is directly integrated into the packet header.
- OSPFv3: Does not have a direct authentication mechanism. Instead, authentication and privacy are ensured through IPsec.
LSA Types (Link-State Advertisements)
- OSPFv2: Contains LSA types specific to IPv4 networks.
- OSPFv3: LSAs are redesigned and optimized for IPv6. Types like Router-LSA and Network-LSA are revised to carry only router ID and link-state information instead of IPv6 address details.
- Multiple Routing Tables
- OSPFv2: Supports routing tables for a single address family (IPv4).
- OSPFv3: Supports multiple address families (IPv4 and IPv6) simultaneously.
Area Concept
- Both versions work similarly with areas. There is no difference between Backbone Area (Area 0) and other areas.
Configuration
OSPFv2: Configured at the network level, not at the interface level.
- OSPFv3: Configured at the interface level. For example, IPv6 addresses and links are directly defined on interfaces.
Let’s Move to the Configuration
The topology I prepared will look like this:
The IPv6 address on the side of the R1 device facing the ISP is 2001:db8:abc:1800:1::2/64,
and on the side facing the internal network, it is 2001:db8:abc:1805::1/64.
Here, 2001:db8:abc is the part assigned to us by the ISP, and the structure on the right side of this is the portion we will divide for our internal networks.
Note: The address block 2001:db8::/32 is reserved specifically for documentation purposes, as defined in RFC 3849.
Now, let’s access the R1 device and assign IPv6 addresses to its interfaces.
By default, the interfaces on our router are administratively down. Let’s bring them up.
As seen, the state has changed to up.
In the next step, IPv6 needs to be enabled on the interfaces. To do this:
Router1(config-if-range)#ipv6 enable
IPv6 is enabled by using the following command:
Router1(config-if)#ipv6 address 2001:db8:abc:1805:1::/64
Then, the IP address is assigned. For interface e0/0, use:
Router1(config-if)#ipv6 address 2001:db8:abc:1800:1::2/64
Distrubition IPv6 addresses with DHCPv6
Router1(config)#ipv6 dhcp pool MY_DHCP
Router1(config-dhcpv6)#address prefix 2001:db8:abc:1805:1::/64
Unlike IPv4 DHCP assignment, where the relevant address is entered using “network” after accessing the pool, in IPv6, the address is entered using “address prefix” instead.
With the configuration in its current state, DHCPv6 assignment will not work. The reason is the absence of the following code:
Router1(config)#ipv6 unicast-routing
The Function of This Command:
The IPv6 unicast-routing command enables the IPv6 routing feature on the router.
By default, IPv6 routing is disabled. You can activate the routing capability by executing this command.
Without this command, OSPFv3 deployment will also not function.
Let’s assign IPv6 addresses to the other routers as shown above.
When a ping is sent, we expect the following result:
OSPFv3 Configuration
When starting the configuration of OSPFv3, unlike previous versions, the router-id must be manually assigned. Otherwise, the system will issue a warning and will not proceed.
First, the following command is entered in global mode:
Router1(config)#ipv6 router ospf 1
When this is stated, the following warning will appear:
Subsequently, the router-id is manually assigned.
Router1(config-rtr)#router-id 2.2.2.2
After that, we need to enter the relevant interfaces and execute the required command. Otherwise, it will not work.
Router1(config-if)#ipv6 ospf 1 area 0
Here, the area is specified, and it will distribute the IPs according to the OSPF ID.
If successful, we can see that it has established a relationship with its neighbor and that the State is Full.
Once this is done on all routers, we will be able to ping from Router1 to Router3 or from PC1 to PC3.
When pinging from Router1 to Router3:
Thanks for reading