Just like OSPF for IPv4, it is possible to advertise a default route in OSPFv3 for IPv6. In this lesson, I’ll show you how to do this.
We only need two routers for this example:
R2 has a loopback interface with IPv6 address 2001:DB8:2:2::2/128. We won’t advertise this in OSPFv3 directly but will reach it from R1 with a default route that is advertised by R2.
First, we have to enable IPv6 routing:
R1 & R2 (config)#ipv6 unicast-routing
Let’s configure some global unicast IPv6 addresses. We don’t need global unicast addresses for OSPFv3 but we will need them if we want to send a ping from R1 to R2’s loopback address.
R1(config)#interface GigabitEthernet 0/1 R1(config-if)#ipv6 address 2001:DB8:12:12::1/64
R2(config)#interface GigabitEthernet 0/1 R2(config-if)#ipv6 address 2001:DB8:12:12::2/64 R2(config)#interface loopback 0 R2(config-if)#ipv6 address 2001:DB8:2:2::2/128
Let’s enable OSPFv3 on R1:
R1(config)#ipv6 router ospf 1 R1(config-rtr)#router-id 188.8.131.52 R1(config)#interface GigabitEthernet 0/1 R1(config-if)#ipv6 ospf 1 area 0
We do the same thing on R2, but also include the default route:
R2(config)#ipv6 router ospf 1 R2(config-rtr)#router-id 184.108.40.206 R2(config-rtr)#default-information originate always R2(config)#interface GigabitEthernet 0/1 R2(config-if)#ipv6 ospf 1 area 0
The default-information originate command is what advertises the default route, it’s the same command that OSPFv2 for IPv4 uses.
Let’s verify our work. First, let’s make sure our two routers are OSPFv3 neighbors:
R1#show ipv6 ospf neighbor OSPFv3 Router with ID (220.127.116.11) (Process ID 1) Neighbor ID Pri State Dead Time Interface ID Interface 18.104.22.168 1 FULL/BDR 00:00:34 3 GigabitEthernet0/1
This seems to be the case. Let’s check if R1 has learned a default route from R2:
R1#show ipv6 route ospf OE2 ::/0 [110/1], tag 1 via FE80::F816:3EFF:FE06:2CB2, GigabitEthernet0/1
Above you can see the default route. Note that it is advertised as an OSPF external type 2 route with a default cost of 1. Let’s see if we can ping the loopback interface of R2:
R1#ping 2001:DB8:2:2::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:DB8:2:2::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 3/6/18 ms
Our ping is working, which proves that our default route works.
Want to take a look for yourself? Here you will find the final configuration of each device.
hostname R1 ! ipv6 unicast-routing ipv6 cef ! interface GigabitEthernet0/1 no ip address ipv6 address 2001:DB8:12:12::1/64 ipv6 ospf 1 area 0 ! ipv6 router ospf 1 router-id 22.214.171.124 ! end
hostname R2 ! ipv6 unicast-routing ipv6 cef ! interface Loopback0 no ip address ipv6 address 2001:DB8:2:2::2/128 ! interface GigabitEthernet0/1 no ip address ipv6 address 2001:DB8:12:12::2/64 ipv6 ospf 1 area 0 ! ipv6 router ospf 1 router-id 126.96.36.199 default-information originate always ! end
You have now learned how to configure an IPv6 OSPFv3 default route with the default-information originate command. Keep in mind you need the always parameter if you don’t have a default route in the routing table of the router that is going to advertise the default route. The default route type is an external type 2 with a cost of 1.