DHCPv6 Relay agent allows clients to obtain IPv6 addresses from DHCPv6 servers located on different subnets. It forwards traffic between the client and the server, enabling proper address assignment. In this section, we will review the DHCPv6 traffic flow and provide a configuration example of how to set up a relay agent between a client and a DHCPv6 server.

DHCPv6 Relay Fundamental

DHCPv6 Relay Traffic Flow

In the previous section, we discussed the traffic flow between the client and the DHCPv6 server, covering the various DHCPv6 message types: Solicit, Advertise, Request, and Reply.

When the DHCPv6 server is in a different subnet and no DHCPv6 relay agent is present, the client cannot communicate with the server using multicast. In this case, the client’s Solicit message will not reach the server, and therefore, the DHCPv6 server cannot respond.

The following figure illustrates the changes that occur when the DHCPv6 server is not on the same subnet as the client. In this scenario, the DHCPv6 relay agent forwards messages between the client and the DHCPv6 server, facilitating communication and address assignment.

DHCPv6 Relay Traffic Flow
DHCPv6 Relay Traffic Flow

As shown in the figure, the DHCPv6 messages from the client’s perspective remain unchanged, allowing the client to send and receive the same messages as if the DHCPv6 server were on the same subnet. However, all these messages are relayed using unicast between the client and the DHCPv6 server through DHCPv6 Relay Forward and DHCPv6 Relay Reply messages. This mechanism enables seamless communication between the client and the server, even when they are on different subnets.

DHCPv6 Relay Configuration Example

To better understand the DHCPv6 relay process, let’s demonstrate a configuration example.

I have prepared a topology with three IOS routers: one acts as the client, one serves as the gateway and DHCPv6 relay agent, and the third functions as the DHCPv6 server, which is connected to a different subnet.

DHCPv6 Relay Configuration Example
DHCPv6 Relay Configuration Example

The link-local address fe80::1 is configured on all interfaces connected to the gateway, while fe80::2 is assigned to the DHCPv6 server. The subnet 2001:AA:BB:CC::/64 is configured for the connection between the client and the gateway, and the subnet 2001:AA:BB:DD::/64 is set up between the gateway and the DHCPv6 server.

A DHCPv6 pool is created with the address prefix 2001:AA:BB:CC:1111::/80, which is a subsection of 2001:AA:BB:CC::/64, excluding all assigned and reserved addresses. This pool is then applied to the interface that receives DHCPv6 Solicit messages.

ipv6 dhcp pool DHCPv6
 address prefix 2001:AA:BB:CC:1111::/80
 dns-server 2001:AA:BB:CC:100::100
 domain-name rayka-co.com
!
interface Ethernet0/0
 no shutdown
 ipv6 address FE80::2 link-local
 ipv6 address 2001:AA:BB:DD::2/64
 ipv6 dhcp server DHCPv6
!
ipv6 route 2001:AA:BB:CC::/64 Ethernet0/0 FE80::1

In the DHCPv6 relay agent, on the interface connected to the clients, the address of the DHCPv6 server is configured using the ipv6 dhcp relay destination command.

ipv6 unicast-routing
!
interface Ethernet0/0
 no shutdown
 ipv6 address FE80::1 link-local
 ipv6 address 2001:AA:BB:CC::1/64
 ipv6 nd managed-config-flag
 ipv6 dhcp relay destination 2001:AA:BB:DD::2
!
interface Ethernet0/1
 no shutdown
 ipv6 address FE80::1 link-local
 ipv6 address 2001:AA:BB:DD::1/64

Finally, we prepare the client to receive an IPv6 address through the DHCPv6 process by using ipv6 address dhcp command.

interface Ethernet0/0
 no shutdown
 ipv6 address dhcp
 ipv6 enable

DHCPv6 Relay Traffic Flow Verification

To verify the DHCPv6 process and traffic flow, we can capture DHCPv6 traffic between the client and the DHCPv6 relay, as well as between the DHCPv6 relay and the DHCPv6 server.

DHCPv6 packets between client and DHCv6 relay and DHCPv6 Server
DHCPv6 packets between client and DHCv6 relay and DHCPv6 Server

As expected, the DHCPv6 messages from the client’s perspective remain unchanged. However, these messages are relayed between the DHCPv6 relay and the DHCPv6 server using DHCPv6 Relay Forward and DHCPv6 Relay Reply messages.

DHCPv6 Relay Operation Verification

To verify the DHCPv6 process, we can first check the IPv6 address assigned to the client using the show ipv6 interface brief command to confirm whether the client has received an IPv6 address from the DHCPv6 server.

Client#show ipv6 interface brief
Ethernet0/0            [up/up]
    FE80::A8BB:CCFF:FE00:100
    2001:AA:BB:CC:1111:2C18:716A:F5C5

Additionally, we can verify the DHCPv6 server’s operation by using the show ipv6 dhcp binding command to see which IPv6 address has been assigned to each client.

DHCPv6-Server#show ipv6 dhcp binding
Client: FE80::A8BB:CCFF:FE00:100
  DUID: 00030001AABBCC000100
  Username : unassigned
  VRF : default
  IA NA: IA ID 0x00030001, T1 43200, T2 69120
    Address: 2001:AA:BB:CC:1111:2C18:716A:F5C5
            preferred lifetime 86400, valid lifetime 172800
            expires at Sep 29 2024 06:47 AM (172788 seconds)
Back to: IPv6 (in progress) > IPv6 Dynamic Addressing

Leave a Reply

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


Post comment