iPXE discussion forum
Boot by mac address - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: Boot by mac address (/showthread.php?tid=6886)



Boot by mac address - mino - 2013-04-24 10:09

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



RE: Boot by mac address - mcb30 - 2013-04-25 15:39

(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


RE: Boot by mac address - robinsmidsrod - 2013-04-26 07:24

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.