ifconf [--configurator <configurator>] [--timeout <timeout>] [<interface>...]
ifconf
ifconf net0
:retry ifconf || goto retry
ifconf --configurator dhcp net0
ifconf --configurator ipv6 net0
Automatically configure a network interface. iPXE will open the first specified network interface and attempt to automatically configure it. If automatic configuration succeeds, the command will terminate and the network interface will be left open. If automatic configuration 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.
If no configurators are explicitly specified, iPXE will try all available configurators.
A configuration timeout can be specified (in milliseconds) using the --timeout
option.
Success | One network interface was successfully configured |
---|---|
Failure | No network interfaces were successfully configured |
The IPv6 protocol is available only when the build option NET_PROTO_IPV6
is enabled.
There is no difference between the commands ifconf
and dhcp
.
ifconf
will not automatically close all other network interfaces before starting to attempt automatic configuration. If you have already opened other network interfaces, then you may wish to execute ifclose
before executing ifconf
.
ifconf
will succeed if any configurator manages to successfully obtain a configuration. If you want to ensure that both DHCP and IPv6 have succeeded, then you must use each configurator explicitly:
ifconf -c dhcp ifconf -c ipv6
Automatic configuration via 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 ifconf -c dhcp && isset ${filename} || goto retry
Where possible, iPXE will automatically detect switches that are not yet forwarding packets (e.g. because the switch is configured to use spanning tree, or 802.1x port authentication, or 802.3ad link aggregation), and will extend the configuration timeout period as needed.