====== Automatically configure interfaces ====== ===== Synopsis ===== ifconf [--configurator ] [--timeout ] [...] ===== Examples ===== === Automatically configure the first available interface === ifconf === Automatically configure the interface "net0" === ifconf net0 === Retry automatic configuration indefinitely until it succeeds === :retry ifconf || goto retry === Automatically configure the interface "net0" using DHCP === ifconf --configurator dhcp net0 === Automatically configure the interface "net0" using IPv6 === ifconf --configurator ipv6 net0 ===== Description ===== 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. ===== Command status ===== ^ Success | One network interface was successfully configured | ^ Failure | No network interfaces were successfully configured | ===== See also ===== * ''[[:cmd:autoboot]]'' * ''[[:cmd:route]]'' * [[:cmd|List of all iPXE commands]] ===== Build options ===== The IPv6 protocol is available only when the build option ''[[:buildcfg:NET_PROTO_IPV6]]'' is enabled. ===== Notes ===== 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 ''[[:cmd: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.