This is an old revision of the document!


Configure interfaces using DHCP

Synopsis

  dhcp [<interface>] [<interface>...]

Examples

Configure the first available interface using DHCP

  dhcp

Configure the interface "net0" using DHCP

  dhcp net0

Retry DHCP indefinitely until it succeeds

  :retry_dhcp
  dhcp || goto retry_dhcp

Description

Configure a network interface using DHCP. iPXE will open the first specified network interface and attempt to acquire an IP address via DHCP. If DHCP succeeds, the command will terminate and the network interface will be left open. If DHCP fails, the network interface will be closed and iPXE will proceed to the next network interface in the list.

If no network interfaces are explicitly specified, iPXE will try all available network interfaces.

Command status

Success One network interface was successfully configured using DHCP
Failure No network interfaces were successfully configured using DHCP

See also

Notes

dhcp will not automatically close all other network interfaces before starting to attempt DHCP. If you have already opened other network interfaces, then you may wish to execute ifclose before executing dhcp.

dhcp will succeed if it manages to obtain an IP address. If you are using a ProxyDHCP server to provide a boot filename, then you may wish to keep retrying DHCP until it obtains a response from the ProxyDHCP server as well as obtaining the IP address from the DHCP server. You can do this using a script fragment such as:

  :retry_dhcp
  dhcp && isset ${filename} || goto retry_dhcp
cmd/dhcp.1332615759.txt.gz ยท Last modified: 2012/03/24 19:02 by mcb30
Recent changes RSS feed CC Attribution-Share Alike 4.0 International Driven by DokuWiki
All uses of this content must include an attribution to the iPXE project and the URL https://ipxe.org
References to "iPXE" may not be altered or removed.