Change DHCP Attributes (CHGDHCPA)

(CHGDHCPA) Use this command to set or change the DHCP Server Attributes: AUTOSTART and MODE

The changes take effect the next time the DHCP server is started.

Restriction:

You must have *IOSYSCFG special authority to use this command.

Parameters

Keyword Description Choices Notes
AUTOSTART Autostart server *YES, *NO, *SAME Optional
MODE Mode *SERVER, *RELAY, *SAME Optional
IPVERSION IP version *IPV4, *IPV6, *ALL, *SAME Optional

Autostart server (AUTOSTART)

The AUTOSTART attribute determines whether or not the DHCP server starts automatically when TCP/IP is started using the STRTCP command, or when the STRTCPSVR SERVER(*AUTOSTART) command is issued.

This attribute is used by the STRTCPSVR command if STRTCPSVR *AUTOSTART is specified. STRTCPSVR *DHCP or STRTCPSVR *ALL will start the DHCP server regardless of the value of the AUTOSTART attribute. There is an exception:

Note: If the STRTCPSVR *ALL command is issued, all TCP/IP servers that have been configured will start. However, a BOOTP and DHCP server cannot both run on the same machine at the same time. If the STRTCPSVR *ALL command is issued, the system will first check to see if both a BOOTP and DHCP server job is configured. If both are configured the system will check the AUTOSTART attribute for each server.

If one of the server (BOOTP or DHCP) AUTOSTART attributes is set to *YES and the other is set to *NO, the server with AUTOSTART attribute set to *YES will start.

If both the BOOTP and DHCP AUTOSTART attributes are set to *NO, the DHCP server will start.

You cannot set the DHCP AUTOSTART attribute to *YES if the BOOTP AUTOSTART value is set to *YES. A BOOTP and DHCP server cannot run simultaneously on the same machine. You will get an error message if you attempt to set both the BOOTP and DHCP AUTOSTART values to *YES.

*SAME
Specify *SAME if you do not want to change the AUTOSTART value from the previous setting. If you specify *SAME and this value was not previously set, the value *NO will be used.
*YES
Specify a value of *YES if you want the DHCP server to start automatically each time TCP/IP is started by the STRTCP command, or each time the TCP/IP servers are started by the STRTCPSVR *AUTOSTART command.
*NO
Specify *NO if you do not want the DHCP server to start automatically each time TCP/IP is started by the STRTCP command, or each time the TCP/IP servers are started by the STRTCPSVR *AUTOSTART command.

When the value is set to *NO, only the STRTCPSVR *DHCP command or the STRTCPSVR *ALL command will start the DHCP server.

If you do not intend to use the DHCP server, set AUTOSTART to *NO.

Mode (MODE)

The MODE attribute determines how the DHCP server will function. It can function as a DHCP server, or as a Relay agent only. A Relay Agent forwards BOOTP or DHCP packets from hosts to active BOOTP or DHCP servers and from the servers back to the hosts. It performs no BOOTP or DHCP server functions.

*SAME
Specify *SAME if you do not want to change the MODE value from the previous setting. If you specify *SAME and this value was not previously set, the value *SERVER will be used.
*SERVER
Set this value to *SERVER if you want the DHCP server to automatically assign reusable IP addresses to hosts in response to host requests.
*RELAY
Set this value to *RELAY if you want the DHCP server to function only as a Relay Agent. A Relay Agent forwards BOOTP or DHCP packets from hosts to active BOOTP or DHCP servers and from the servers back to the hosts. It performs no BOOTP or DHCP server functions.

IP version (IPVERSION)

The IPVERSION attribute determines what IP address versions the DHCP server will service. It can service only IP version 4 (IPv4), only IP version 6 (IPv6) or all IP versions.

*SAME
Specify *SAME if you do not want to change the IPVERSION value from the previous setting. If you specify *SAME and this value was not previously set, the value *ALL will be used.
*IPV4
Set this value to *IPV4 if you want the DHCP server to only service DHCP requests from DHCP clients using IP version 4.
*IPV6
Set this value to *IPV6 if you want the DHCP server to only service DHCP requests from DHCP clients using IP version 6.
*ALL
Set this value to *ALL if you want the DHCP server to service DHCP requests from DHCP clients running any IP version.

Examples

Example 1: Start the DHCP Server automatically

CHGDHCPA   AUTOSTART(*YES)

This command indicates that the next time the STRTCP command is issued to start up TCP/IP and to automatically start the TCP/IP applications, the DHCP Server will be started automatically.

Example 2: Have DHCP Function as a BOOTP/DHCP Relay Agent

CHGDHCPA   AUTOSTART(*SAME)  MODE(*RELAY)

This command indicates that the next time the DHCP Server gets started, it should function as a BOOTP/DHCP Relay Agent. It will no longer attempt to process DHCP packets on the local system, but will instead relay them. If DHCP is currently running, this command has no affect on its current execution mode, since CHGDHCPA attributes do not take affect until the next time the server is started. The autostart attribute is not changed.

Example 3: Only allow DHCP Server to be Started Manually

CHGDHCPA   AUTOSTART(*NO)  MODE(*SERVER)

This command indicates that the DHCP Server should not be started automatically with the rest of TCP/IP when the STRTCP command is issued. It can only be started manually via the STRTCPSVR command. Via the MODE setting of *SERVER, this example is also causing the DHCP server to attempt to process all DHCP packets received on this system.

Example 4: Only allow DHCP Server for IP version 4 to be Started

CHGDHCPA   AUTOSTART(*SAME)  MODE(*SAME)  IPVERSION(*IPV4)

This command indicates that the next time the DHCP Server gets started it should only process DHCP packets received on IP version 4.

Error messages

None