How to configure OSPFv3 for IPv6 Network
Published: 2023-08-08 14:48:26


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lox2rw5wtqbtkx4dgqlx.png)
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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/de0juhb77buuctt4hkhl.png)
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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ppyf9lkn2ymmpaopntj.png)
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 <show ipv6 int brief> we can see a Link-local address and Global Unicast Address were assigned to the interfaces.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1kyadv7rzjw2ds1hdj3z.png)
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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kag6medmuz7o9yxptwrf.png)
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 <show ipv6 ospf int brief>, you will have no results.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5nnu8ki14f8813wp8v90.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w8gsb05gnhfitcb0gtuj.png)

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 <ipv6> word instead of <ip> in the commands.

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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w2h9vc8a37lj24m8cbw5.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmlug5balylxd6r1gt58.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6fxg0sn20uv6zelkv84n.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5duegwmvtydajt3nrxnx.png)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zhbxdo3ye6cc6a74nybj.png)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4l920wsqs5oekb8vdt1.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3f0z1fq1mb99ezeue7zl.png)

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

Now running **<show ipv6 ospf neighbor>** in Router 2 and Router 3, we can see the neighbor relationships formed, which means, they can exchange routing information.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dclui4r22tlwhm4t6qku.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ecsqkpx78tdk4izt5d1f.png)

Last, I will show you the output of the command **<show ipv6 route>** 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qrtrnt61okgnip2qeske.png)

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

Thank you for reading.