Lesson Contents
In the IPv6 SLAAC (Stateless Autoconfiguration) lesson I explained how IPv6 routers send router advertisements which hosts can use to receive the prefix on the subnet, configure their own IPv6 address using EUI-64 and how they select the router as a default gateway.
What happens however when we have more than one router on the subnet? Which router advertisement will our host then use? To figure this out, we’ll use the following topology:
We have two routers, R1 and R2 who will send router advertisements. Our host will be configured for SLAAC so that it will configure its own IPv6 address. With two router advertisements, our host will have to make a decision which one to use.
Let’s start with the configuration.
Configuration
First we will enable IPv6 unicast routing on R1 and R2, otherwise they won’t send any router advertisements:
R1 & R2
(config)#ipv6 unicast-routing
Let’s configure a global unicast address on each router so that they can advertise a prefix in the RA:
R1(config)#interface GigabitEthernet 0/1
R1(config-if)#ipv6 address 2001:DB8:123:123::1/64
R2(config)#interface GigabitEthernet 0/1
R2(config-if)#ipv6 address 2001:DB8:123:123::2/64
That’s all we have to do on the routers. Before we configure the host, let’s enable a debug so we can see the router advertisements in real-time:
R1 & R2 & H1
#debug ipv6 nd
ICMP Neighbor Discovery events debugging is on
Now we will configure the host to use the router advertisements for autoconfiguration:
Host(config)#interface GigabitEthernet 0/1
Host(config-if)#ipv6 address autoconfig
As soon as you enable this command, the host will send a router solicitation:
H1#
ICMPv6-ND: (GigabitEthernet0/1) Sending RS
The routers will receive the router solicitation and will respond with a router advertisement:
R1#
ICMPv6-ND: (GigabitEthernet0/1) Sending solicited RA
ICMPv6-ND: (GigabitEthernet0/1,FE80::F816:3EFF:FE8F:86C2) send RA to FF02::1
ICMPv6-ND: (GigabitEthernet0/1,FE80::F816:3EFF:FE8F:86C2) Sending RA (1800) to FF02::1
ICMPv6-ND: MTU = 1500
ICMPv6-ND: prefix 2001:DB8:123:123::/64 [LA] 2592000/604800
R2#
ICMPv6-ND: (GigabitEthernet0/1) Sending solicited RA
ICMPv6-ND: (GigabitEthernet0/1,FE80::F816:3EFF:FE19:6D0) send RA to FF02::1
ICMPv6-ND: (GigabitEthernet0/1,FE80::F816:3EFF:FE19:6D0) Sending RA (1800) to FF02::1
ICMPv6-ND: MTU = 1500
ICMPv6-ND: prefix 2001:DB8:123:123::/64 [LA] 2592000/604800
What does our host think of this?
H1#
ICMPv6-ND: (GigabitEthernet0/1,FE80::F816:3EFF:FE19:6D0) Received RA
ICMPv6-ND: [default] New router interface context created/GigabitEthernet0/1
ICMPv6-ND: [default] New router interface context created/C645C24
ICMPv6-ND: [default] inserted router FE80::F816:3EFF:FE19:6D0/GigabitEthernet0/1
ICMPv6-ND: [default] Select default router
ICMPv6-ND: [default] best rank is 811
ICMPv6-ND: [default] router FE80::F816:3EFF:FE19:6D0/GigabitEthernet0/1 is new best
ICMPv6-ND: [default] Selected new default router
ICMPv6-ND: [default] Install default to FE80::F816:3EFF:FE19:6D0/GigabitEthernet0/1
ICMPv6-ND: Prefix : 2001:DB8:123:123::, Length: 64, Vld Lifetime: 2592000, Prf Lifetime: 604800, PI Flags: C0
ICMPv6-ND: New on-link prefix 2001:DB8:123:123::/64 on GigabitEthernet0/1/FE80::F816:3EFF:FE19:6D0, lifetime 2592000
ICMPv6-ND: Autoconfiguring 2001:DB8:123:123:F816:3EFF:FEDF:47FD on GigabitEthernet0/1
Above you can see that it receives the RA from R2 first which is selected as the default router. The host configures its own address with the prefix it receives. A few seconds later it receives the RA from R1:
H1#
ICMPv6-ND: (GigabitEthernet0/1,FE80::F816:3EFF:FE8F:86C2) Received RA
ICMPv6-ND: [default] New router interface context created/C645C24
ICMPv6-ND: [default] inserted router FE80::F816:3EFF:FE8F:86C2/GigabitEthernet0/1
ICMPv6-ND: [default] Select default router
ICMPv6-ND: [default] best rank is 811
ICMPv6-ND: Prefix : 2001:DB8:123:123::, Length: 64, Vld Lifetime: 2592000, Prf Lifetime: 604800, PI Flags: C0
ICMPv6-ND: Update on-link prefix 2001:DB8:123:123::/64 on GigabitEthernet0/1/FE80::F816:3EFF:FE8F:86C2, lifetime 2592000
Another way to verify that we received two router advertisements is by using the show ipv6 routers command:
H1#show ipv6 routers
Router FE80::F816:3EFF:FE19:6D0 on GigabitEthernet0/1, last update 1 min
Hops 64, Lifetime 1800 sec, AddrFlag=0, OtherFlag=0, MTU=1500
HomeAgentFlag=0, Preference=Medium
Reachable time 0 (unspecified), Retransmit time 0 (unspecified)
Prefix 2001:DB8:123:123::/64 onlink autoconfig
Valid lifetime 2592000, preferred lifetime 604800
Router FE80::F816:3EFF:FE8F:86C2 on GigabitEthernet0/1, last update 1 min
Hops 64, Lifetime 1800 sec, AddrFlag=0, OtherFlag=0, MTU=1500
HomeAgentFlag=0, Preference=Medium
Reachable time 0 (unspecified), Retransmit time 0 (unspecified)
Prefix 2001:DB8:123:123::/64 onlink autoconfig
Valid lifetime 2592000, preferred lifetime 604800
If you want to see which one was selected as the default then you need to add the default parameter:
H1#show ipv6 routers default
Router FE80::F816:3EFF:FE19:6D0 on GigabitEthernet0/1, last update 1 min
Hops 64, Lifetime 1800 sec, AddrFlag=0, OtherFlag=0, MTU=1500
HomeAgentFlag=0, Preference=Medium, trustlevel = 0
Reachable time 0 (unspecified), Retransmit time 0 (unspecified)
Prefix 2001:DB8:123:123::/64 onlink autoconfig
Valid lifetime 2592000, preferred lifetime 604800
Great, as you can see our host is using R2 as the default router. Why? all parameters in the router advertisements from our routers are equal so there’s nothing in the RA that the host will use to make a selection. It decided to use R2 since that’s the first RA that it received. We can demonstrate this by shutting the interface on R2:
R2(config)#interface GigabitEthernet 0/1
R2(config-if)#shutdown
R2 will inform our host that it is leaving, you can see it in the debug:
i did the configuration with 2 routers and a workstation with win 7, the comand router-preference has no impact at all.
Is there something i missed in Win7 ?
Finally the only way i found is to deactivate the nd protocol to make sure there is only one gateway in win 7.
But i loose the failover for slaac.
Two questions,
- the first RS that the host sent, what are the source/destination IPs/MACs in use in the RS packet ?
- If the gi0/1 interface on R2 was getting shutdown immediately how could the host receive the RA msg from R2 ? Is it part of port shutdown procedures to send out RA ?
- How about a router shutdown? Is RA being generated ?
Hello Ray,
In the RS, the source MAC address is the host’s MAC address, the destination is the “all routers multicast” destination FF02::2.
About the “shutdown procedure”, I just labbed this up to see how it works. Take a look at this wireshark capture:
https://www.cloudshark.org/captures/69fd7a31fe57
The first packet (length 118) is a regular router advertisement. The second packet (length 102) is sent when the interface is shut but also when you reload the router.
The difference between the two is that in the “goodbye” router advertisement, all ICMPv6 options
... Continue reading in our forumGood question.
I just keep a doubt, RA is sent periodically like BPDU or OSPF hello interval?
Regards