iflinkwait [--timeout <timeout>] [<interface>] [<interface>...]
iflinkwait net0
iflinkwait --timeout 5000
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.
Success | A link was detected |
---|---|
Failure | No link was detected |
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).