Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
(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.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
AUTOSTART | Autostart server | *YES, *NO, *SAME | Optional |
MODE | Mode | *SERVER, *RELAY, *SAME | Optional |
Top |
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.
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.
Top |
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.
Top |
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.
Top |
None
Top |