DHCPv6 server

Overview

A DHCPv6 server is typically used to configure the IPv6 addresses of the hosts connected to its different LAN subnets, upon their request.

It needs at least one IPv6 subnet on which one interface is configured and a range of addresses to be allocated to DHCPv6 clients.

Supported features:

  • Configuration: The DHCPv6 server can be configured in the dhcpv6 server context, per VRF and L3VRF.

  • IPv6 non-temporary-address assignation: The DHCPv6 server can be configured to be able to lease a range of predetermined IPv6 non-temporary addresses (NA) to the requesting clients.

  • Prefix-delegation: DHCPv6 Prefix Delegation (PD) is a feature of DHCPv6 that allows a network router (DHCPv6 client) to request and receive an IPv6 address prefix from a DHCPv6 server. The router can then divide this prefix into smaller subnets for local devices, simplifying IPv6 address management in large or dynamic networks.

  • Option handling: The DHCPv6 server supports the use of DHCPv6 options, which are structured pieces of data used to convey configuration information such as DNS settings or delegated prefixes. Options are included in messages exchanged between clients and the server to enable flexible and extensible network configuration.

  • Relay server specification: The DHCPv6 server allows manual specification of relay agent IPv6 addresses when the relay’s link address does not match the server’s directly connected subnet, ensuring proper client address assignment and message routing across routed or multi-link environments.

  • Unicast listen address configuration: The DHCPv6 server can be configured to listen on a specific unicast IPv6 address for a given subnet, allowing precise control over server reachability and response behavior in multi-interface or segmented network deployments.

Configuration:

The following example configures a subnet with a range of non-temporary addresses to assign, and performs prefix delegation with 65536 prefixes available to delegate:

vsr running config# / vrf main dhcpv6 server default-lease-time 200
vsr running config#! / vrf main dhcpv6 server max-lease-time 250
vsr running config#! / vrf main dhcpv6 server rebinding-time 160
vsr running config#! / vrf main dhcpv6 server renewal-time 100
vsr running config#! / vrf main dhcpv6 server subnet fd:50::/32
vsr running subnet fd:50::/32#! / vrf main dhcpv6 server subnet fd:50::/32 interface eth2
vsr running subnet fd:50::/32# / vrf main dhcpv6 server subnet fd:50::/32 range fd:50:10:: fd:50:20::
vsr running subnet fd:50::/32# / vrf main dhcpv6 server subnet fd:50::/32 prefix-delegation fd:50:30::/48 length 64

The same configuration can be made using this NETCONF XML configuration:

vsr> show config xml absolute vrf main dhcpv6 server
<config xmlns="urn:6wind:vrouter">
  <vrf>
    <name>main</name>
    <dhcpv6 xmlns="urn:6wind:vrouter/dhcpv6">
      <server>
        <enabled>true</enabled>
        <default-lease-time>200</default-lease-time>
        <max-lease-time>250</max-lease-time>
        <renewal-time>100</renewal-time>
        <rebinding-time>160</rebinding-time>
        <subnet>
          <prefix>fd:50::/32</prefix>
          <interface>eth2</interface>
          <range>
            <start-ip>fd:50:10::</start-ip>
            <end-ip>fd:50:20::</end-ip>
          </range>
          <prefix-delegation>
            <prefix>fd:50:30::/48</prefix>
            <length>64</length>
          </prefix-delegation>
        </subnet>
      </server>
    </dhcpv6>
  </vrf>
</config>

See also

The |dhcpv6| server command reference for details.

Displaying |dhcpv6| server state:

The DHCPv6 server state can be displayed per VRF and/or L3VRF.

vsr> show state vrf main dhcpv6 server
server
    enabled true
    default-lease-time 200
    max-lease-time 250
    renewal-time 100
    rebinding-time 160
    subnet fd:50::/32
        interface eth2
        range fd:50:10:: fd:50:20::
        prefix-delegation fd:50:30::/48 length 64
        ..
    ..

Configuring DHCPv6 server prefix-delegation

DHCPv6 Prefix Delegation (PD) is a mechanism within the DHCPv6 protocol that allows an upstream DHCPv6 server (typically an ISP or central network administrator) to assign an IPv6 address prefix to a requesting router (often a customer-premises equipment (CPE) device or downstream router). This enables the client router to dynamically obtain an IPv6 address block that it can further subdivide and assign to its internal network interfaces.

The main goal of Prefix Delegation is to provide a flexible, scalable, and dynamic way to allocate IPv6 address space to routers, simplifying the management of IPv6 address assignments for networks.

How Prefix Delegation Prefix and Delegated Length Interact in DHCPv6

In the context of DHCPv6 Prefix Delegation, two key components are involved in the process of delegating address space:

  • Prefix: This is the IPv6 address block that will be subdivided into prefixes of the delegated length to a requesting router (DHCPv6 client). It’s typically represented as an IPv6 network with a specified prefix length, such as 2001:db8::/56 or 2001:db8:1::/48.

  • Delegated Length: This refers to the size of the prefix that is delegated to the client. It determines the number of bits in the delegated prefix and essentially defines the size of the address block allocated to the client router.

Example interaction between Prefix and Delegated Length

Scenario: An ISP’s DHCPv6 server is configured to assign from a /48 prefix to a client router, with a delegated length of 56.

Prefix: 2001:db8:0::/48 (configured in the DHCPv6 server).

Delegated Length: 56 (defines the size of the block the client can use from the /48 prefix).

In this case, the DHCPv6 server delegates the first /56 from the /48 prefix, meaning the client router gets 2001:db8:0:0::/56. This block of /56 can then be subdivided by the client router into multiple /64 subnets (since the most common subnet size in IPv6 is /64) or given as individual addresses. The remaining part of the address space (2001:db8:0:1::/56, 2001:db8:0:2::/56, etc.) can be assigned to other clients.

The delegated length indicates how many bits are available to the server for subnetting within the prefix. A delegated length of 56 means that the client can receive up to 256 prefix delegations (since 56-48 = 8 bits, and 2^8 = 256 subnets).

Summary of the Interaction: Prefix: Specifies the starting point of the address block (e.g., 2001:db8:0::/48)

Delegated Length: Defines how much address space is delegated to the client (e.g., 56).

The client router receives a prefix (e.g., 2001:db8:0:0::/56) from the DHCPv6 server and can then subdivide this space into smaller subnets (typically /64 subnets) or give addresses from it. The difference between the prefix length and the delegated length determines how many subnets the client router can request.

Configuring DHCPv6 server unicast-listen address

By default, the DHCPv6 server listen on the multicast and link-local address on the designated interface for the subnet, to make it listen to a unicast address, this has to be specified in the configuration of the subnet with an address belonging to the designated interface. It is required to answer to requests from a relay-server in a different subnet.

Configuring DHCPv6 relay-servers addresses

By default, the DHCPv6 server will only answer to relays providing a link-address belonging in the subnet, if they are not part of the subnet, their IPv6 addresses should be indicated in the relay-server configuration item for this specific subnet.

Configuring DHCPv6 options

unicast

The Unicast option (Option Code 12) is used by a DHCPv6 server to inform a client that it should send subsequent DHCP messages directly (unicast) to a specified IPv6 address instead of using multicast. This can improve efficiency and reduce multicast traffic in certain network environments.

Domain-name-system-server

The Domain-name-system-server option (Option Code 23) is used in DHCPv6 to inform clients of one or more IPv6 addresses of DNS recursive name servers that the client can use for domain name resolution. This option is typically included in DHCPv6 Reply or Advertise messages to configure the client’s DNS settings.

custom-options

DHCPv6 supports the use of custom options to extend protocol functionality beyond the predefined standard options. These custom options can either:

1. Use standard option codes, where the option must be defined exactly as specified in the official DHCPv6 option registry (e.g., IANA registry or RFCs). 2. Use unassigned option codes, intended for truly custom, proprietary, or experimental implementations.

Guidelines

  • When defining a custom option that uses a standard DHCPv6 option code, the format and data type, must strictly follow the official definition. A reference data table (provided below) must be used to ensure full compliance.

  • If a custom option is needed for functionality not defined in the standards, you must use an unassigned or private-use option code (i.e., a code not listed in the IANA DHCPv6 Option Codes registry).

  • Re‑defining or modifying the structure of a standard option under the same option code is not allowed and will result in the server not starting.

Standard DHCPv6 Options

Option Code

Option Name

Data Type

Array?

7

preference

uint8

false

12

unicast

ipv6-address

false

21

sip-server-dns

fqdn

true

22

sip-server-addr

ipv6-address

true

23

dns-servers

ipv6-address

true

24

domain-search

fqdn

true

27

nis-servers

ipv6-address

true

28

nisp-servers

ipv6-address

true

29

nis-domain-name

fqdn

true

30

nisp-domain-name

fqdn

true

31

sntp-servers

ipv6-address

true

32

information-refresh-time

uint32

false

33

bcmcs-server-dns

fqdn

true

34

bcmcs-server-addr

ipv6-address

true

36

geoconf-civic

uint8,uint16,binary

false

37

remote-id

uint32,binary

false

38

subscriber-id

binary

false

39

client-fqdn

uint8,fqdn

false

40

pana-agent

ipv6-address

true

41

new-posix-timezone

string

false

42

new-tzdb-timezone

string

false

43

ero

uint16

true

44

lq-query

uint8,ipv6-address

false

45

client-data

empty

false

46

clt-time

uint32

false

47

lq-relay-data

ipv6-address,binary

false

48

lq-client-link

ipv6-address

true

51

v6-lost

fqdn

false

52

capwap-ac-v6

ipv6-address

true

53

relay-id

binary

false

56

ntp-server

empty

false

57

v6-access-domain

fqdn

false

58

sip-ua-cs-list

fqdn

true

59

bootfile-url

string

false

60

bootfile-param

tuple

true

61

client-arch-type

uint16

true

62

nii

uint8,uint8,uint8

false

64

aftr-name

fqdn

false

65

erp-local-domain-name

fqdn

false

66

rsoo

empty

false

67

pd-exclude

binary

false

74

rdnss-selection

ipv6-address,uint8,fqdn

true

79

client-linklayer-addr

binary

false

80

link-address

ipv6-address

false

82

solmax-rt

uint32

false

83

inf-max-rt

uint32

false

88

dhcp4o6-server-addr

ipv6-address

true

89

s46-rule

uint8, uint8,uint8, ipv4-address, ipv6-prefix

false

90

s46-br

ipv6-address

false

91

s46-dmr

ipv6-prefix

false

92

s46-v4v6bind

ipv4-address, ipv6-prefix

false

93

s46-portparams

uint8, psid

false

94

s46-cont-mape

empty

false

95

s46-cont-mapt

empty

false

96

s46-cont-lw

empty

false

103

v6-captive-portal

string

false

136

v6-sztp-redirect

tuple

true

143

ipv6-address-andsf

ipv6-address

true

144

v6-dnr

uint16, uint16,fqdn, binary

false

148

addr-reg-enable

empty

false

Managing DHCPv6 server leases

Displaying DHCPv6 server leases

You can flush DHCPv6 leases by IPv6, L3VRF, or VRF. These filters help narrow down the flush operation.

Example

vsr> show dhcpv6-server lease type non-temporary-address
show-dhcpv6-server-lease
    dhcpv6-lease
        type non-temporary-address
        address fd:50:10::
        mac-address de:ed:02:e3:fa:cc
        preferred-lifetime 200
        valid-lifetime 250
        ..
    ..

Flushing DHCPv6 server leases

You can flush the DHCPv6 leases by IPv6, L3VRF, VRF those filters are used to narrow down the flush query.

Example

vsr> flush dhcpv6-server lease type any
1 IPv6 lease flushed successfully.