Automatically configure interfaces

Synopsis

  ifconf [--configurator <configurator>] [--timeout <timeout>] [<interface>...]

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

Build options

The IPv6 protocol is available only when the build option 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 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.

cmd/ifconf.txt ยท Last modified: 2021/01/26 17:34 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.