Router Advertisement Preference is an option in IPv6 Router Advertisement (RA) messages that indicates the priority of a router to be chosen as the default gateway by hosts on a network. It helps hosts decide which router to prefer when multiple routers are present.

Table of Contents

Gateway redundancy with router advertisement preference

In previous lessons, we discussed Router Advertisement (RA) messages and demonstrated how these messages help clients discover network prefixes and default gateways. We also explored how clients can use RA messages to obtain IPv6 addresses through dynamic addressing flags.

In this section, we will examine another feature of Router Advertisement messages that allows for simple gateway redundancy without requiring protocols like VRRP.

   +-----------+       +-----------+       +-----------+
   |  Router 1 |       |  Router 2 |       |  Router 3 |
   |  (High)   |       | (Medium)  |       |  (Low)    |
   +-----------+       +-----------+       +-----------+
        |                   |                   |
        |                   |                   |
    ---------------------------------------------------
                    Network Segment
    ---------------------------------------------------
                         |
                         |
                    +------------+
                    |   Client   |
                    +------------+
                         |
                  Prefers Router 1

When multiple routers in a network send RA messages, the client can discover more than one default gateway. By default, all gateways have the same preference level, which is set to “medium.” However, you can adjust this preference to “low” or “high” to influence which gateway the client uses for traffic forwarding.

Routers with a higher preference will be prioritized as default gateways over those with lower preferences. This provides flexibility for load balancing and for designating backup routers without the need for more complex redundancy protocols.

Rrouter Advertisement Preference in IPv6

To better understand how Router Advertisement (RA) works, I have set up a topology where a client is connected to a network with two gateways.

The routers are configured with the global addresses 2001:AA:BB:CC::1/64 and 2001:AA:BB:CC::2/64, and the link-local addresses fe80::1 and fe80::2.

ipv6 router advertisement preference
ipv6 router advertisement preference
# GW1
ipv6 unicast-routing
!
interface Ethernet0/0
 no shutdown
 ipv6 address FE80::1 link-local
 ipv6 address 2001:AA:BB:CC::1/64

#Gw2
ipv6 unicast-routing
!
interface Ethernet0/0
 no shutdown
 ipv6 address FE80::2 link-local
 ipv6 address 2001:AA:BB:CC::2/64

# Client
interface Ethernet0/0
 no shutdown
 ipv6 address autoconfig

By enabling the command ipv6 unicast-routing globally on the routers, they start sending Router Advertisement (RA) packets both periodically and in response to Router Solicitations.

We can modify the default interval for sending RAs (which is 200 seconds) using the interface-level command ipv6 nd ra interval INTERVAL. This changes the frequency of RA packets sent on the interface.

On the client side, we enable IPv6 autoconfiguration using SLAAC with the command ipv6 address autoconfig. This allows the client to automatically obtain an IPv6 address based on the RAs it receives.

After enabling SLAAC, we can verify if the client has successfully obtained an IPv6 address by using the show ipv6 interface brief command.

Client#show ipv6 int brief
Ethernet0/0            [up/up]
    FE80::A8BB:CCFF:FE00:100
    2001:AA:BB:CC:A8BB:CCFF:FE00:100

Using the show ipv6 route command, we can see which default gateway the client is using. Since both gateways have the same preference, the client selects the default gateway based on the first received RA message. This explains why the default gateway points to one of the two routers.

ipv6 router advertisement preference medium
ipv6 router advertisement preference medium
Client#show ipv6 route
IPv6 Routing Table - default - 4 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP
       H - NHRP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
       IS - ISIS summary, D - EIGRP, EX - EIGRP external, NM - NEMO
       ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect
       O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2, ls - LISP site
       ld - LISP dyn-EID, a - Application
ND  ::/0 [2/0]
     via FE80::2, Ethernet0/0
NDp 2001:AA:BB:CC::/64 [2/0]
     via Ethernet0/0, directly connected
L   2001:AA:BB:CC:A8BB:CCFF:FE00:100/128 [0/0]
     via Ethernet0/0, receive
L   FF00::/8 [0/0]
     via Null0, receive

change router preference

In the next step, we change the preference of one of the two routers from medium to high. After making this change, we expect the client to update its default gateway to the router with the higher preference. This adjustment ensures that the client prioritizes the router with the higher preference over the other one.

GW1(config-if)#ipv6 nd router-preference high
ipv6 router advertisement preference high
ipv6 router advertisement preference high

Router with high preference fails

what happens when the router with hight preference fails.

We simulate it wit suppresing the router adevrtisement with high prefrence.

The command ipv6 nd ra suppress all on a router interface completely suppresses all Router Advertisement (RA) messages for both periodic RA and also solicited RA.

The client will no longer receive Router Advertisements from the gateway with the higher preference, causing it to switch its default gateway to the next available router.

GW1(config-if)#ipv6 nd ra ?
  dns        DNS
  hop-limit  IPv6 RA hop-limit value
  interval   Set IPv6 Router Advertisement Interval
  lifetime   Set IPv6 Router Advertisement Lifetime
  mtu        IPv6 RA MTU Option
  suppress   Suppress IPv6 Router Advertisements
GW1(config-if)#ipv6 nd ra suppress ?
  all  Suppress all IPv6 Router Advertisements
  <cr>
GW1(config-if)#ipv6 nd ra suppress all
Client#show ipv6 route
IPv6 Routing Table - default - 4 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP
       H - NHRP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
       IS - ISIS summary, D - EIGRP, EX - EIGRP external, NM - NEMO
       ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect
       O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2, ls - LISP site
       ld - LISP dyn-EID, a - Application
ND  ::/0 [2/0]
     via FE80::2, Ethernet0/0
NDp 2001:AA:BB:CC::/64 [2/0]
     via Ethernet0/0, directly connected
L   2001:AA:BB:CC:A8BB:CCFF:FE00:100/128 [0/0]
     via Ethernet0/0, receive
L   FF00::/8 [0/0]
     via Null0, receive

As you can see, IPv6 provides a built-in capability for a very basic gateway redundancy, similar to VRRP, without the need for any additional redundancy protocols.

Back to: IPv6 (in progress) > IPv6 Neighbor Discover Protocol (NDP)

Leave a Reply

Your email address will not be published. Required fields are marked *


Post comment