DHCP Server Configuration

DHCPv4 and DHCPv6 server configuration allows you assign IP addresses and manage subscriber settings for IPv4 and IPv6 clients. These settings control how access devices communicate with external DHCP servers, including how to reach the server, which source address to use.

Configuring DHCPv4 Server

You can configure the DHCP server for IP address allocation using the following command and options.

Syntax:

set access dhcp-server <server-name> address <address>
set access dhcp-server <server-name> routing-instance <routing-instance>
set access dhcp-server <server-name> source-address <source-address>

Attribute Description

-

Without any option, the command configures a DHCPv6 server instance with the specified name.

address

Specifies the global DHCPv4 server IP address.

routing-instance

Defines the routing instance through which the DHCPv4 server is reachable.

source-address

Specifies the source IPv4 address used for DHCPv4 packets.

The following example shows a DHCPv4 server configuration. It indicates the DHCP server name as 'dhcp-server1', which is the identifier for the DHCP server. The DHCP server’s IP address is specified as '172.16.0.10', and the source IP address is specified as '172.16.0.2', which is used by the DHCP server when sending out packets. The routing instance name is set as 'default', which indicates that the DHCP server is accessible through the default instance.

supervisor@switch: cfg> show config access dhcp-server
{
  "rtbrick-config:dhcp-server": [
    {
      "server-name": "dhcp-server1",
      "address": "172.16.0.10",
      "source-address": "172.16.0.2",
      "routing-instance": "default"
    }
  ]
}

api  To access the RESTCONF API that corresponds to this CLI, click here.

Configuring DHCPv6 Server

The following commands and options are used to configure a DHCPv6 server.

Syntax:

set access dhcpv6-server <server-name> address <address>
set access dhcpv6-server <server-name> routing-instance <routing-instance>
set access dhcpv6-server <server-name> source-address <source-address>

Attribute Description

-

Without any option, the command creates a DHCPv6 server configuration.

address

Specifies the DHCPv6 server address.

routing-instance

Specifies the routing instance from which the DHCPv6 server is reachable.

source-address

Specifies the source address used for DHCPv6 packets.

The following example shows a DHCPv6 configuration. It shows the DHCPv6 server name is specified as ‘dhcpv6-server1’ which is the identifier for the DHCPv6 server. The IP address is specified as '172:16::2'. The source IP address is specified as '172:16::10', which is used by the DHCPv6 server when sending out packets. The routing instance name is set as 'default'. It indicates the DHCPv6 server is accessible through the default instance.

supervisor@switch: cfg> show config access dhcpv6-server
{
  "rtbrick-config:dhcpv6-server": [
    {
      "server-name": "dhcpv6-server1",
      "address": "172:16::2",
      "source-address": "172:16::10",
      "routing-instance": "default"
    }
  ]
}

api  To access the RESTCONF API that corresponds to this CLI, click here.