set dhcpserver

Purpose

Configures the DHCP server settings for the Digi device. A DHCP server allows other devices or hosts on the same local network as the Digi device to be assigned dynamic IP addresses. This DHCP server supports a single subnetwork scope. The Digi DHCP server scope can be on a LAN interface only. That is, the Dig DHCP server serves IP addresses to DHCP clients on the Ethernet side of the Digi device only. Supported interfaces include:

The Digi DHCP server and this command do not serve WAN or point-to-point interfaces, such as pppX (PPP interface (serial)), mobile0 (mobile/cellular), or wmx0 (WiMAX).

The DHCP server operates only if the Digi device is configured to use static IP address configuration. For information on how to configure static IP settings, see set network and the help for the web interface’s Network Configuration settings.

Once configured, the DHCP server is managed through the dhcpserver command. See dhcpserver.

Required permissions

For Digi products with two or more users, to use this command, permissions must be set to set permissions s‑dhcpserver=read to display DHCP server settings, and set permissions s‑dhcpserver=rw to display and configure DHCP server settings. See set permissions for details on setting user permissions for commands.

Syntax

Configure the DHCP server: basic settings

set dhcpserver item={scope|reservation|exclusion}
[action={set|revert}]

item={scope|reservation|exclusion}

Specifies the configuration settings to which the command will be applied. The item option defaults to scope if not specified.

action={set|revert}

Specifies the action to be performed by the set dhcpserver command. This option defaults to set if not specified.

action={set|revert}

Specifies the action to be performed by the set dhcpserver command.

set

Sets the DHCP configuration settings to the specified values. This is the default setting that is used if this option is not specified.

revert

Resets the configuration settings for the specified item to default values.

Configure the DHCP server scope (“item=scope”)

To enable a scope, or a reservation or exclusion entry within a scope, all of its parameters must be specified and valid. A scope or entry can be enabled only if it is completely valid.

set dhcpserver item=scope
[action={set|revert}]
[name=scope interface name]
[enabled={on|off}]
[startip=ip address]
[endip=ip address]
[leasetime={time|infinite}] (in seconds, 0=default (86400)}
[offerdelay=0-5000] (time in milliseconds, default 500}
[conflictdetect={on|off}]
[dnsproxy={on|off}]
[gatewayopt={ifaddress|ifgateway|gwoptip|none}]
[gwoptip=ip address]

Configure the scope's address reservations (“item=reservation”)

In this type of configuration, the DHCP server assigns a particular IP address to a Digi device, rather than a random address from a pool.

set dhcpserver item=reservation
[action={set|revert}]
[range={1-16|all}]
[enabled={on|off}]
[ip=ip address]
[clientid=client MAC address] {e.g., 00:40:9D:12:34:56}
[leasetime={time|infinite}] {in seconds, 0=default (use scope's time)}

Configure the scope's address exclusions (“item=exclusion”)

set dhcpserver item=exclusion
[action={set|revert}]
[range={1-4|all}]
[enabled={on|off}]
[startip=ip address]
[endip=ip address]

Option rules on scope, reservation, or exclusion entries

For a reservation or exclusion entry, the range option selects the specific entry to which the action is to be applied.

To enable a scope, or a reservation or exclusion entry within a scope, all of its parameters must be specified and valid. A scope or entry can be enabled only if it is completely valid.

Display current DHCP server settings

set dhcpserver

Options

Options for configuring the DHCP server scope (“item=scope”)

item=scope

Specifies that the DHCP server configuration settings apply to the scope of IP addresses for a network. A scope is the full consecutive range of possible IP addresses for a network. A scope typically defines a single physical subnet on your network, to which DHCP services are offered. A scope is the primary way for the DHCP server to manage distribution and assignment of IP addresses and related configuration parameters to its clients on the network.

action={set|revert}

Specifies the action to be performed by the set dhcpserver command.

set

Sets the DHCP configuration settings to the specified values. This is the default setting that is used if this option is not specified.

revert

Resets the configuration settings for the specified item to default values.

name=scope interface name

A valid interface name for the scope. The default is eth0.

enabled={on|off}

Enables the DHCP server feature on this Digi device. Note that for the DHCP server to operate, the Digi device must be configured to use a static IP address.

startip=ip address

The first IP address in the pool.

endip=ip address

The last address in the pool. The addresses in the range specified by startip and endip must be in the same subnet as the Digi device.

leasetime={time|infinite}

The length, in seconds, of the leases for the scope being served by this DHCP server. Specifying a time of 0 means that the default of 86400 seconds (24 hours) will be used. A DHCP client may request a lease duration other than this setting, and the DHCP server will grant that request, if possible.

offerdelay=0-5000

The interval of time, in milliseconds, to delay before offering a lease to a new client. The range for this delay is 0 to 5000 milliseconds, and the default delay is 500 milliseconds. Use of this delay permits the Digi device to reside on a network with other DHCP servers, yet not offer leases to new clients unless the other DHCP servers do not make such an offer. This provides a measure of protection against inadvertently connecting a Digi device to a network that is running its own DHCP server, and thereby offering leases to clients in a manner inconsistent with that network.

conflictdetect={on|off}

When a DHCP client requests a new IP address lease, before offering an IP address to that client, use ping to test whether that IP address is already in use by another host on the network but is unknown to the DHCP Server. If an IP address is determined to be in use, it is marked as Unavailable for a period of time, and it will not be offered to any client while in this state.

Enabling this test adds approximately one second of delay before the IP address is offered to the client, since the ping test must not receive a valid reply for that test to successfully determine that the IP address is not already in use.

This option is off (disabled) by default. This option does not apply to Static Lease Reservations, since the ping test is not used for them.

dnsproxy={on|off}

Enables or disables sending the DHCP server IP address as DNS proxy. Default is on.

Note The DHCP server IP address is not sent if DNS proxy is disabled. Basically, this means that if the DNS Proxy feature is disabled by the set dnsproxy command, then the DHCP server will not include its own IP address as a DNS server in the lease it sends to its DHCP clients.

gatewayopt={ifaddress|ifgateway|gwoptip|none}

Gateway option. The purpose of the gatewayopt and gwoptip options is to enhance the DHCP server's configurability in terms of the default gateway that the server will provide to its DHCP clients for DHCP Option 3, Routers On Subnet. This option configures the DHCP Server to send DHCP Option 3: Routers on Subnet, to its DHCP clients in the lease information. Choices for this option include:

ifaddress

The IP address of the scope's network interface is sent to the client via DHCP Option 3. This choice is on (enabled) as the default.

ifgateway

The configured default gateway IP address for the scope's network interface is sent to the client via DHCP Option 3.

Send the configured IP address of the default gateway for the scope interface.

gwoptip

The gateway IP address specified by the gwoptip option is sent to the client via DHCP Option 3. This address must be reachable by the client or IP routing will not succeed.

none

No default gateway is sent to the client via DHCP Option 3.

gwoptip=ip address

If gatewayopt=gwoptip is specified, this option specifies the IP address of the gateway.

Options for configuring the scope's address reservations (“item=reservation”)

item=reservation

Specifies that the DHCP server configuration settings apply to the scope’s address reservations. You may use a reservation to create a permanent address lease assignment by the DHCP server. Reservations assure that a specified hardware device on the subnet can always use the same IP address. Address lease reservations associate a specific IP address with a specific client’s Ethernet MAC address.

action={set|revert}

Specifies the action to be performed by the set dhcpserver command.

set

Sets the DHCP configuration settings to the specified values. This is the default setting that is used if this option is not specified.

revert

Resets the configuration settings for the specified item to default values. This effectively removes the entry specified by the range option.

range={1-16|all}

Selects the specific entry to which the action is to be applied.

enabled={on|off}

Enables the DHCP server feature on this Digi device. For the DHCP server to operate, the Digi device must be configured to use a static IP address.

ip=ip address

The IP address reserved for the client. This value must not be the same as the IP address of the DHCP Server itself.

clientid=client MAC address

The MAC address for the client, for example, 00:40:9D:12:34:56.

leasetime={time|infinite}

The length, in seconds, of the leases for the scope being served by this DHCP server. Specifying a time of 0 means that the default of using the scope’s lease time will be used. A DHCP client may request a lease duration other than this setting, and the DHCP server will grant that request, if possible. Leaving this option blank causes the default value specified in the scope to be used. That default changes whenever the scope changes.

Options for configuring the scope's address exclusions (“item=exclusion”)

item=exclusion

Specifies that the DHCP server configuration settings apply to the scope’s address exclusions. An exclusion range is a limited sequence of IP addresses within a scope, excluded from DHCP service offerings. Exclusion ranges assure that any addresses in these ranges are not offered by the server to DHCP clients on the network. Note that the IP address of the DHCP server itself will not be given out to any DHCP clients, even if it is within the range specified on this command.

action={set|revert}

Specifies the action to be performed by the set dhcpserver command.

set

Sets the DHCP configuration settings to the specified values. This is the default setting that is used if this option is not specified.

revert

Resets the configuration settings for the specified item to default values. This effectively removes the entry specified by the range option.

range={1-4|all}

Selects the specific entry to which the action is to be applied.

enabled={on|off}

Enables the DHCP server feature on this Digi device. Note that for the DHCP server to operate, the Digi device must be configured to use a static IP address.

startip=ip address

The first address in the exclusion block.

endip=ip address

The last address in the exclusion block. An IP address exclusion range must specify valid IP addresses in the subnetwork of the DHCP server. The DHCP server will ignore an exclusion that does not meet this requirement.

Examples

Configure the IP address range for the DHCP server scope and enable the DHCP server

set dhcpserver item=scope action=set enabled=on startip=10.30.1.150 endip=10.30.1.199

Since the leasetime and offerdelay options are not specified, the default values for them are used, unless they were previously changed to another value by use of a set dhcpserver item=scope command (or using the web UI).

Add an IP address reservation for a client

set dhcpserver item=reservation action=set range=1 enabled=on ip=10.30.1.195 clientid=00:09:26:19:51:05

Since the leasetime option is not specified, the DHCP server's scope lease time is used, unless a lease time was previously changed to a value by use of a set dhcpserver item=reservation action=set range=1 command (or using the web UI).

Disable all reservations that were previously added:

set dhcpserver item=reservation action=set range=all enabled=off

Permanently remove a reservation that was previously added

set dhcpserver item=reservation action=revert range=1

Any client that has the lease for the reserved IP address that is removed in this manner, still keeps its lease. However, without the reservation, future address leases to that client are not guaranteed to be for this same IP address, which is the purpose of a reservation.

Add an IP address exclusion range for the scope:

set dhcpserver item=exclusion action=set range=1 enabled=on startip=10.30.1.170 endip=10.30.1.179

This exclusion instructs the DHCP server to not issue leases for the IP addresses from 10.30.1.170 to 10.30.1.179 inclusive. Note that reservation leases may be configured for any address in that range, and the DHCP server permits a lease of such an address to the correct client only. That is, reservations override exclusions.

Display current DHCP server settings

#> set dhcpserver

 DHCP Server Settings:

    server enabled       : on
    scope name           : eth0
    starting ip address  : 10.30.1.190
    ending ip address    : 10.30.1.198
    lease time           : 3600 (seconds)
    offer delay          : 500 (milliseconds)
    addr conflict detect : off
    send DNS proxy       : on
    gateway option       : ifaddress
    gateway opt ip addr  : 0.0.0.0 (N/A)
  Reservation Settings:

    idx enabled ip address      client id          lease time
    --- ------- --------------- -----------------  ----------
    1   on      10.30.1.135     00:40:9D:24:73:F8        3600
    2   on      10.30.1.195     00:09:26:19:51:05           0
    3   on      10.30.1.196     00:09:26:19:51:06           0
    4   on      10.30.1.197     00:09:26:19:51:07           0
    5   on      0.0.0.0         00:00:00:00:00:00           0
    6   on      0.0.0.0         00:00:00:00:00:00           0
    7   off     0.0.0.0         00:00:00:00:00:00           0
    8   off     0.0.0.0         00:00:00:00:00:00           0
    9   off     0.0.0.0         00:00:00:00:00:00           0
    10  off     0.0.0.0         00:00:00:00:00:00           0
    11  off     0.0.0.0         00:00:00:00:00:00           0
    12  off     0.0.0.0         00:00:00:00:00:00           0
    13  off     0.0.0.0         00:00:00:00:00:00           0
    14  off     0.0.0.0         00:00:00:00:00:00           0
    15  off     0.0.0.0         00:00:00:00:00:00           0
    16  off     0.0.0.0         00:00:00:00:00:00           0

    A reservation lease time of 0 means to use the scope's lease time.
Exclusion Settings:

    idx enabled start address   end address
    --- ------- --------------- ---------------
    1   off     0.0.0.0         0.0.0.0
    2   off     0.0.0.0         0.0.0.0
    3   off     0.0.0.0         0.0.0.0
    4   off     0.0.0.0         0.0.0.0

See also