This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cmd:dhcp [2011/02/27 12:43] mcb30 |
cmd:dhcp [2014/01/29 14:19] (current) mcb30 |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Configure interface(s) using DHCP ====== | + | ~~REDIRECT>cmd:ifconf~~ |
- | + | ||
- | ===== 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 ===== | + | |
- | + | ||
- | * [[:cmd:autoboot]] | + | |
- | * [[:cmd|List of all iPXE commands]] | + | |
- | + | ||
- | ===== 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 ''[[:cmd: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 | + | |