# Configuring the DHCPv6 Local Address Pools

The IPv6 local address pool for DHCP is an object that contains information about prefix configuration parameters and guidelines that govern the assignment of these prefixes to requesting routers. If you configured an interface for prefix delegation, the prefix assigned to that interface takes precedence over the prefix or range of prefixes configured at the router level in an IPv6 local pool.

To configure an IPv6 local address pool to be used for DHCPv6 prefix delegation:

1. Enable the IPv6 local address pool to assign prefixes to the requesting router.
   host1(config)#ipv6 address-pool local
2. Configure the name of the IPv6 local address pool from which the delegating router assigns prefixes to the DHCPv6 client or requesting router.
   host1(config)#ipv6 local pool dhcpv6pd_pool

   | Note: You must enable the IPv6 local address pool feature to be able to configure IPv6 local address pools.

3. Specify the IPv6 prefix range from which prefixes can be delegated to the DHCPv6 client. You can specify the prefix range in one of the following ways:
   - Configure the prefix range by specifying an IPv6 prefix and the length of the prefix to be delegated. This prefix length is also called the assigned prefix length.
     host1(config-v6-local)#prefix 2002:2002::/32 48

     In this case, the starting and ending prefixes of the range are implicitly specified. In this example, the start of the range is 2002:2002::/48 and the end of the range is 2002:2002:ffff::/48. All prefixes assigned from this range have 48 as the prefix length.

   - Alternatively, configure the prefix range by specifying the starting and ending IPv6 prefixes of the range.
     host1(config-v6-local)#prefix 3003:3003::/56 3003:3003:0:1000::/56

     In this case, the starting and ending prefixes of the range are explicitly specified. In the preceding example, a prefix range is configured with 16 prefixes that can be allocated to clients. All prefixes assigned from this range have 56 as the prefix length. When you specify the prefix range in this way, you must ensure that the starting and ending prefixes are of the same length.

4. Specify the time period when the requesting router can use the prefix. You can configure a preferred lifetime or a valid lifetime for the requesting router to use when you configure the prefix range. If no lifetime is specified when you configure the prefix range, the default lifetime of 1 day is assigned.

   | Note: The preferred lifetime must be less than or equal to the valid lifetime.

   - Specify the number of days and, optionally, the number of hours, minutes, and seconds. You cannot specify a lifetime of zero (that is, you cannot set the days, hours, minutes, and seconds fields all to zero).
     host1(config-v6-local)#prefix 5005:5005::/32 48 preferred 1 2 3 4

     In this example, the preferred lifetime is set to 1 day, 2 hours, 3 minutes, and 4 seconds. Because the valid lifetime is not configured, the default value of 1 day is assigned.

   - Use the infinite keyword to specify a lifetime that does not expire.
     host1(config-v6-local)#prefix 5005:5005::/32 48 valid infinite

     In this example, the period for which the prefix remains valid indefinitely for the requesting router to use after it has been delegated by the DHCPv6 server. In this case, the preferred lifetime is set to 1 day by default.

5. Specify the IPv6 address of the DNS servers to be returned to the client. You can configure a primary and secondary DNS server. The DNS server addresses are returned to the client in DHCPv6 responses as part of the DNS Recursive Name Server option.
   host1(config-v6-local)#dns-server 3001::1 3001::2

   If the DNS server is not configured in the IPv6 local address pool, the DNS server configured on the DHCPv6 local server is used to delegate prefixes. However, if DNS servers are configured both in the IPv6 local pool and on the DHCPv6 local server, the values configured in the IPv6 local pool take precedence.

6. Specify the name of a DNS domain in the IPv6 local pool to be returned to clients in the DHCPv6 responses as part of the Domain Search List option. The client uses this domain name for DNS resolution. You can specify a maximum of four DNS domains for an IPv6 local pool’s search list.
   host1(config-v6-local)#dns-domain-search test1.com host1(config-v6-local)#dns-domain-search test2.com

   You can configure one domain name per line. Enter the command on separate lines to configure additional domain names.

7. Set certain prefixes to be excluded from being allocated to the requesting router. You can exclude those addresses that are assigned to local interfaces. You can exclude specific prefixes or a range of prefixes from delegation to clients.
   host1(config-v6-local)#exclude-prefix 5005:5005:2::/48 5005:5005:a::/48

   In this example, all prefixes between the starting prefix of the range, 5005:5005:2::/48, and the ending prefix of the range, 5005:5005:a::/48 are excluded from allocation to clients.

8. Map the domain name to the IPv6 local address pool, which is used for prefix delegation. If the authentication server returns the prefix pool name in the Framed-Ipv6-Pool attribute of the RADIUS-Accept-Request message, this value overrides the IPv6 local pool configured using the ipv6-prefix-pool-name command.
   host1(config)#aaa domain-map westford.com host1(config-domain-map)#ipv6-prefix-pool-name local_addr_pool

   For more information about mapping domain names to the IPv6 local address pool, see ipv6-prefix-pool-name.

## Limitation on the Number of Prefixes Used by Clients

If you a configure a very large prefix range in an IPv6 local address pool, the number of prefixes that can be used from that range by DHCPv6 clients is limited to 1048576.

Consider the following example in which an IPv6 local address pool, largePrefixRange, is configured. The prefix range is specified by the starting prefix and its length as 3003:3003::/32.

host1(config)#ipv6 local pool largePrefixRange host1(config-v6-local)#prefix 3003:3003::/32 64 host1(config-v6-local)#end

The Total field of the output of the following show ipv6 local pool largePrefixRange and show ipv6 local pool commands indicates the number of prefixes that can be allocated to DHCPv6 clients: 1048756.

    host1#show ipv6 local pool largePrefixRange

    Pool : largePrefixRange
    -----------------------
    Utilization : 0
              Start                        End               Total    In Use
    -------------------------   -------------------------   -------   -------
    3003:3003::/64              3003:3003:ffff:ffff::/64    1048576   0
                                                 Preferred      Valid
              Start             Exclude   Util    Lifetime     Lifetime
    -------------------------   -------   ----   ----------   ----------
    3003:3003::/64              0         0      1 day        1 day

    host1#show ipv6 local pool
                             IPv6 Local Address Pools
                             ------------------------
          Pool                   Start                        End
    ----------------   -------------------------   -------------------------
    largePrefixRange   3003:3003::/64              3003:3003:ffff:ffff::/64
          Pool          Total    In Use
    ----------------   -------   -------
    largePrefixRange   1048576   0