Lesson Contents
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.
Configuration
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 1.1.1.1
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 2.2.2.2
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.
Verification
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 (1.1.1.1) (Process ID 1)
Neighbor ID Pri State Dead Time Interface ID Interface
2.2.2.2 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.
Configurations
Want to take a look for yourself? Here you will find the final configuration of each device.
R1
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 1.1.1.1
!
end
R2
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 2.2.2.2
default-information originate always
!
end
Conclusion
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.
Why do you have to activate OSPF on the interface? You don’t have to do this for IPv4.
This question was originally posted by @maxturpin, I’m not sure why it has changed ownership. However, I will answer the question here.
OSPFv3 has a different philosophy than OSPFv2 for IPv4. In IPv4, OSPF is enabled globally and the participating networks are added using the
... Continue reading in our forumnetwork
command. OSPFv3 functions differently. You enable OSPF on the participating interface. in this way, you are indicating which subnets are participating (the subnet directly connected to the interface) and you are also indicating the area to which the interface belongs. This isHi Rene,
... Continue reading in our forumWhat is signfinace of TAG value …I see it get changes in examples . For example ,in your document it is 1 and in my example it is 100
Hi Vinod,
Good question, I never really noticed it before. The answer is in the RFC:
https://datatracker.ietf.org/doc/html/rfc5340
... Continue reading in our forumHi Rene/Laz
Could you explain this sentence: “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”
Thanks,
Phil.