dhcpc command (DHCP Client)

Description

DHCP client is used for automatic retrieving of different parameters from DHCP server for one or several unit’s network interfaces. Among the parameters are IP-address, network mask, default gateway etc.

Syntax:

  dhcpc [options] [IFNAME] [commands]options:
        -l (none|default|$ACLNAME|acl:ACLNAME) - set server id accesslist name
        -k (none|default|key:KEYVALUE)         - set authorization method
        -a (none|default|NUMBER)               - set arp attempts number
        -c (none|default|CLIENT-CLASS ID)      - set DHCP Client Class ID - any string
                                                 Default Class ID - "AW-E5000-MESH"
        If IFNAME was not specified, it sets default option(s) value
        -t (on|off)                            - turn trace on/off
commands:
        start  - start dhcp on specified interface
        stop   - stop dhcp on specified interface
        delete - remove dhcp from specified interface
        dump   - show current dhcp status

Parameters

Parameter
Description

start

Starts DHCP client on the specified interface.

stop

Stops DHCP client on the specified interface.

delete

Stops DHCP client on the specified interface and clears all options.

dump

Shows current status of DHCP client.

IFNAME

Name of the network interface to which options are referred. If no interface name is specified, options are set as default for the whole client.

There are special values that can be specified for upcoming parameters: "none" and "default".

  • "none" this parameter does not work for this interface even though default value of this parameter exists.

  • "default" there is no specific parameter value. Default option value is not displayed in DHCP client configuration.

Parameter
Description

-l (none|default|$ACLNAME|acl:ACLNAME)

Sets the list of IP-addresses of DHCP servers from which the client is permitted to receive parameters.

  • "ACLNAME" – the name of access control list (see acl command). If specified list is not configured in the system (this acl does not exist), DHCP client will be able to receive parameters from any DHCP server.

-k (none|default|key:KEYVALUE)

Sets authorization key. DHCP authorization is in accordance with "RFC 3118 - Authentication for DHCP Messages".

-a (none|default|NUMBER)

Sets the number of repeated arp requests which sends DHCP client after getting a lease of IP-address from DHCP server. In accordance with DHCP, the client is obliged to check received IP-address if there are any other network devices with the same IP-address. For higher reliability, DHCP client sends a series of such request with 1/4 second interval. If arp requests number is not specified for all of the interfaces (including absence of default value for this parameter), DHCP client sends 16 requests.

–c (none|default|CLIENT-CLASS ID)

Sets the class identifier of DHCP client.

"CLIENT-CLASS ID" – the name of identifier. Type of input data: any string (for example "AW-E5000-MESH").

-t (on|off)

This option turns on/off sending debug information to the system log. The option is not attached to any specific interface.

Examples

This configuration sets the number for ARP requests of 5.

dhcpc –a 5

For "eth0" interface the list of allowed DHCP servers is specified in "DHCP_SERVERS".

dhcpc –l $DHCP_SERVERS eth0 start

The client is started for "eth0" interface. For "rf6.0" interface none option is set for the number of ARP requests. Thus, "rf6.0" will send 16 ARP requests. Also, DHCP client on "rf6.0" interface will use "qwerty" as authorization key.

dhcpc –a none –k key:qwerty  rf6.0 start

The command prints current status of DHCP client.

dhcpc dump

Here, clients are started on "eth0" and "rf6.0" interfaces.

For "eth0" interface DHCP client obtained a lease for "192.168.61.26" IP-address with 26 bits network mask length from "192.168.61.1" DHCP server. The lease expires in 35 minutes and 16 seconds.

DHCP client on "rf6.0" interface has not yet received any parameters.

ID  I-face   IP address/mask    Gateway address   Server ID    Lease exp.
== ======== ==================  ===============   ===
 0   eth0   192.168.61.29/26    192.168.61.1      192.168.61.1 000:35:16
 1   rf6.0  ------------------  ---------------

Last updated

Astra Wireless Technology © 2024. All rights reserved. For more information about available models, sales and technical support, please proceed to https://astrawireless.net/