Wait for link-up

Synopsis

  iflinkwait [--timeout <timeout>] [<interface>] [<interface>...]

Examples

  iflinkwait net0
  
  iflinkwait --timeout 5000

Description

Wait for link-up on a network interface. iPXE will open the first specified network interface and wait for a link to be detected. If a usable link is detected, the command will terminate and the network interface will be left open. If no link is detected, 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.

A configuration timeout can be specified (in milliseconds) using the –timeout option. If no timeout is specified, iPXE will wait indefinitely for a link to be detected.

Command status

Success A link was detected
Failure No link was detected

See also

Notes

You do not normally need to use this command. iPXE will automatically wait for the link to be detected when configuring the interface using the ifconf or dhcp or autoboot commands.

If no timeout has been specified then iPXE will wait indefinitely for a link to be detected, or until the command is cancelled using Ctrl-C.

If the command succeeds then you can use the ifname setting to retrieve the name of the successful interface. For example:

  iflinkwait -t 5000 && echo Detected link on ${ifname} || goto no_link

iflinkwait will detect only a physical link up. It is possible that the link may not yet be forwarding packets. For example: if the link is connected to a switch port that is configured to require LACP then the switch will not forward packets until LACP negotiation has completed. There is no way for iPXE to detect this situation until you attempt to transmit a packet (e.g. by using the ifconf command).

cmd/iflinkwait.txt · Last modified: 2021/01/26 17:31 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.