iPXE discussion forum

Full Version: Boot by mac address
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

is there any solution to boot from a specific interface by mac address?

Code:
autoboot net0

Doesnt work reliable on some of my machines because net0 is sometimes net1 of the boot before. But i can identify my interfaces explicit by mac address. Any solution for that?

Just great would be:

Code:
autoboot 00:1f:bc:32:0a:c5
(2013-04-24 10:09)mino Wrote: [ -> ]
Code:
autoboot net0

Doesnt work reliable on some of my machines because net0 is sometimes net1 of the boot before. But i can identify my interfaces explicit by mac address. Any solution for that?

You can use the iseq command to check the MAC address of an interface. For example:

Code:
set mac:hex 00:1f:bc:32:0a:c5
set bootif net0
iseq ${${bootif}/mac} ${bootmac} && goto boot ||
set bootif net1
iseq ${${bootif}/mac} ${bootmac} && goto boot ||
...
:boot
autoboot ${bootif}

There isn't currently any way to iterate over the available net devices, though such a facility may be added in the near future.

Michael
Mino: You might also find interesting this embedded menu: https://gist.github.com/robinsmidsrod/3871687

It doesn't do exactly what you wanted, but it shows a similar way to choose which network interface to boot from interactively using a menu.
Reference URL's