Cisconinja’s Blog

IPv6 Default Router Preference

Posted by Andy on March 12, 2009

In my post on IPv6 Neighbor Discovery, we saw that a Cisco router acting as a host would, by default, use the first router that it learned of as it’s default router for sending traffic to off-link destinations.  The default router preference (DRP) extension allows routers to use previously unused bits in the RA message to tell hosts what preference they should use for that router.  The DRP extension was not introduced until 12.4(2)T.  We will look at what happens when one router (R1) implements the DRP extension and another router (R2) does not.  We will also look at how 3 hosts using various IOS versions react.  The topology is shown below:

ipv6-default-router-preference

First we will configure link-local addresses on each device, global addresses on R1 and R2, and configure R2 to route IPv6 unicast packets:

R1:
interface FastEthernet0/0
 ipv6 address FE80::1 link-local
 ipv6 address 2001:DB8:0:1::1/64

R2:
interface FastEthernet0/0
 ipv6 address FE80::2 link-local
 ipv6 address 2001:DB8:0:1::2/64
!
ipv6 unicast-routing

HostA:
interface FastEthernet0/0
 ipv6 address FE80::A link-local

HostB:
interface FastEthernet0/0
 ipv6 address FE80::B link-local

HostC:
interface FastEthernet0/0
 ipv6 address FE80::C link-local

Next we will configure each host to obtain an address through stateless autoconfiguration:

HostA:
interface FastEthernet0/0
 ipv6 address autoconfig

HostB:
interface FastEthernet0/0
 ipv6 address autoconfig

HostC:
interface FastEthernet0/0
 ipv6 address autoconfig

Each host autoconfigures itself an address on the 2001:db8:0:1::/64 subnet and learns R2 as the default router:

1-hosta-show-int

2-hostb-show-int1

3-hostc-show-int

Now we will enable R1 to begin sending RA messages on the link:

R1:
ipv6 unicast-routing

The hosts learn of R1 as a router, but still prefer R2 as their default router because it was learned first:

4-hosta-show-routers

5-hostb-show-routers

6-hostc-show-routers

7-hosta-show-int1

8-hostb-show-int1

9-hostc-show-int

Next we will try to change the DRP so that R1 is preferred.  R2 does not support the DRP extension so we will have to make the change on R1 by setting the router preference to high:

R1:
interface FastEthernet0/0
 ipv6 nd router-preference high

After changing the router preference on R1, R1’s RA messages look like this:

10-r1-ra-wireshark1

R2’s RA messages look like this:

11-r2-ra-wireshark

The 4th and 5th bits of the flags are used to carry the router preference.  R1 sets the bits to 01 to indicate a preference of high.  A router that does not implement DRP sets the bits to 00, which is interpreted by devices that understand DRP as a preference of medium.  A preference of low would set the bits to 10.  HostA understands the router preference bits and changes it’s default router to be R1:

12-hosta-show-routers

HostA#debug ipv6 nd
Mar 1 00:17:55.879: ICMPv6-ND: Received RA from FE80::1 on FastEthernet0/0
Mar 1 00:17:55.879: ICMPv6-ND: Selected new default router FE80::1 on FastEthernet0/0

13-hosta-show-int

HostB understands the router preference, but does not change it’s default router:

14-hostb-show-routers

15-hostb-show-int

HostC has no knowledge of the router preference bits or their meaning and also does not change it’s default router:

16-hostc-show-routers

17-hostc-show-int

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: