DEV Community

esmeralda
esmeralda

Posted on

How to configure OSPFv3 for IPv6 Network

Image description
Hello!

I hope you are doing well.

The objective of this post is to guide you to configure OSPFv3 for an IPv6 network.

OSPFv3 is a link-state protocol for IPv4 and IPv6, however, we will work here on an IPv6 network. Because of that, to better understand this article, you are requested to have a solid knowledge of IPv6. In addition, knowing how OSPFv2 works can help you as well.

This is our topology:

Image description
Before starting I have a heads-up. If you follow this tutorial and your network doesn’t work as expected, save your work and restart packet tracer. Sometimes the software crashes and failures occur.

Let’s get started!

Router 1

Image description
Let’s start with router 1.

First, to run OSPFv3 and IPv6 addresses in the network we need to enable ipv6 routing.

R1(config)#ipv6 unicast-routing

Next, we have to configure ipv6 addresses on the interfaces.

R1(config)#int loop 0
R1(config-if)#ipv6 address 2001:abcd:1::1/64
R1(config-if)#int g0/0/0
R1(config-if)#ipv6 address 2001:1::1/64
R1(config-if)#no shut

Running the command we can see a Link-local address and Global Unicast Address were assigned to the interfaces.

Image description
After enabling ipv6 we are now able to configure a routing protocol that in our example will be OSPF with a process ID of 1. ipv6 router ospf 1

Image description
Note that OSPF in IPv6 runs similarly to IPv4 and we have a message to configure a router-id. You have to set a 32-bit router-id. In this example, I assigned this router 1.1.1.1.

At this point in our configuration, if you run the command , you will have no results.

Image description

The reason for that is we need to assign each interface to the OSPFv3 with the command ipv6 ospf process-id-number area area-number. So let’s do it!

R1(config)#int loop 0
R1(config-if)#ipv6 ospf 1 area 1
R1(config-if)#int g0/0/0
R1(config-if)#ipv6 ospf 1 area 1
R1(config-if)#end

Now, after configuring the two interfaces and running show ipv6 ospf brief, we are able to see them added to OSPFv3.

Image description

If you are following this tutorial in packet tracer and you don’t see g0/0/0 listed after running this command, you need to enable (no shut) the neighbor interface in the neighbor router.

Also, it is important to highlight that many of the OSPFv2 commands in IPv4 commands are similar to IPv6. Usually what it changes is that we add word instead of in the commands.

A useful command when troubleshooting is show ipv6 protocols. We can see the interfaces in OSPF and the areas.

Image description

After following the first router configuration, we can do basically the same configuration on the other routers of our network, just paying attention to the interfaces and areas that we are configuring. In summary, we can follow these steps:

1- Enable ipv6 unicast-routing

2- Configure IPv6 addresses on the interfaces ipv6 address

3- Configure a routing protocol with a process-id ipv6 router ospf process-id

4- Assign a router-id to our router

5- Assign each interface to OSPFv3 with the command ipv6 ospf process-id-number area area-number. Remember to assign each interface to the correct area id.

6- Check if it is correctly assigned show ipv6 ospf int brief

Now let’s finish the configuration of the rest of the network.

Router 2

Image description

1- Enable IPv6 routing and configure interfaces in router 2 with IPv6 addresses.

R2(config)#ipv6 unicast-routing
R2(config)#int loop0
R2(config-if)#ipv6 address 2001:abcd:2::1/64
R2(config-if)#int g0/0/0
R2(config-if)#ipv6 address 2001:1::2/64
R2(config-if)#no shut
R2(config-if)#int g0/0/1
R2(config-if)#ipv6 address 2001:2::1/64
R2(config-if)#no shut
R2(config-if)#exit

2- Pay attention to the interfaces’ areas. They must be added to the proper area as stated in our topology (refer to the picture if you need it).

R2(config)#ipv6 router ospf 1
%OSPFv3-4-NORTRID: OSPFv3 process 1 could not pick a router-id,please configure manually
R2(config-rtr)#router-id 2.2.2.2
R2(config-rtr)#int g0/0/0
R2(config-if)#ipv6 ospf 1 area 1
R2(config-if)#int loop 0
R2(config-if)#ipv6 ospf 1 area 1
R2(config-if)#int g0/0/1
R2(config-if)#ipv6 ospf 1 area 0

3- Check if the interface was assigned to the expected area.

Image description

I think you have grasped the configuration process, so let me share with you the commands to configure the final routers. Remember to be attentive to the areas that each interface must be added.

Router 3

R3(config)#ipv6 unicast-routing
R3(config)#int loop 0
R3(config-if)#ipv6 address 2001:abcd:3::1/64
R3(config-if)#int g0/0/0
R3(config-if)#ipv6 address 2001:2::2/64
R3(config-if)#no shut
R3(config-if)#int g0/0/1
R3(config-if)#ipv6 address 2001:3::1/64
R3(config-if)#no shut
R3(config)#ipv6 router ospf 1
R3(config-rtr)#router-id 3.3.3.3
R3(config-rtr)#int g0/0/0
R3(config-if)#ipv6 ospf 1 area 0
R3(config-if)#int loop 0
R3(config-if)#ipv6 ospf 1 area 2
R3(config-if)#int g0/0/1
R3(config-if)#ipv6 ospf 1 area 2

Running a troubleshooting command on Router 3 we can see that the configuration is right.

Image description

Router 4

R4(config)#ipv6 unicast-routing
R4(config)#int loop 0
R4(config-if)#ipv6 address 2001:abcd:4::1/64
R4(config-if)#int g0/0/0
R4(config-if)#ipv6 address 2001:3::2/64
R4(config-if)#no shut
R4(config-if)#exit
R4(config)#ipv6 router ospf 1
%OSPFv3-4-NORTRID: OSPFv3 process 1 could not pick a router-id,please configure manually
R4(config-rtr)#router-id 4.4.4.4
R4(config-rtr)#int loop 0
R4(config-if)#ipv6 ospf 1 area 2
R4(config-if)#int g0/0/0
R4(config-if)#ipv6 ospf 1 area 2

Image description

Troubleshooting OSPFv3

When the whole configuration is done, we can run some commands to see if everything is working fine.

Some useful commands are:

show ipv6 route
show ipv6 ospf neighbor
show ipv6 ospf
show ipv6 ospf database

I will run some commands to demonstrate if our network is designed well. The first useful command is <ping>. It is important to verify if one router can ping each other.

Image description

Image description

Router 1 and Router 4 can ping each other’s loopback interface.

Now running in Router 2 and Router 3, we can see the neighbor relationships formed, which means, they can exchange routing information.

Image description

Image description

Last, I will show you the output of the command in Router 1.

You can see that R1 learned the routes to R2, R3, and R4 through OSPFv3 and can communicate with all of them. The code of OSPF routes is “O” and “OI”.

Image description

I will finish here, but you can run more commands to learn more about the network you worked on.

Thank you for reading.

Top comments (0)