preferred-lifetime (DHCPv6)

Specifies the length of time that the DHCPv6 server keeps the IPv6 prefix active.
Syntax
preferred-lifetime interval
Command Default

The preferred lifetime interval is 0 seconds by default.

Parameters
interval
Specifies the time interval in seconds. The default is 0.
Modes

DHCPv6 server configuration mode

DHCPv6 subnet configuration mode

Usage Guidelines

Once the configured time interval expires, the IPv6 prefix is deprecated. The preferred lifetime interval must be less than or equal to the valid lifetime interval. Refer to the valid-lifetime command for more information.

When configuring the DHCPv6 server using this command along with the valid-lifetime (DHCPv6), renewal-time] (DHCPv6), and rebind-time (DHCPv6) commands, enter the commands in the following order:

  1. preferred-lifetime (DHCPv6)
  2. valid-lifetime (DHCPv6)
  3. rebind-time (DHCPv6)
  4. renewal-time (DHCPv6)
Note: Failure to enter the commands in this order when configuring the DHCPv6 server results in a CLI error.

If a preferred lifetime is not configured in DHCPv6 subnet configuration mode, the globally configured preferred lifetime is inherited.

The DHCPv6 lease expiry is calculated based on the current-time with the valid-lifetime configured, and must not exceed the value of 2147483647 seconds. The below error occurs when the preferred-lifetime configuration exceeds the allowed value:

device(config-dhcp6-subnet)# preferred-lifetime 4294967290
Error: preferred-lifetime + current-time must not exceed 2147483647
device(config-dhcp6-subnet)#

The no form of the command restores the default.

Examples

The following example sets the preferred lifetime to 200 seconds.

device# configure terminal
device(config)# ipv6 dhcp6-server enable
device(config-dhcp6)# preferred-lifetime 200

The following example sets the preferred lifetime to 100 seconds in DHCPv6 subnet configuration mode.

device# configure terminal
device(config)# ipv6 dhcp6-server enable
device(config-dhcp6)# subnet6 3ffe:501:ffff:100::/64
device(config-dhcpv6-subnet)# preferred-lifetime 100
History
Release version Command history
08.0.90 This command was introduced.