iPXE discussion forum
How does iPXE assign a network interface to net0? - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: How does iPXE assign a network interface to net0? (/showthread.php?tid=7509)



How does iPXE assign a network interface to net0? - Rickert - 2014-10-24 10:14

Hi,

iPXE allows to dhcp using net0 interface. But, I wonder how is net0 configured by iPXE? Is there a way to determine which physical network interface will be chosen for net0? Do you know where in the source code this process happens?

Thanks in advance.


RE: How does iPXE assign a network interface to net0? - mcb30 - 2014-10-24 14:01

(2014-10-24 10:14)Rickert Wrote:  iPXE allows to dhcp using net0 interface. But, I wonder how is net0 configured by iPXE? Is there a way to determine which physical network interface will be chosen for net0? Do you know where in the source code this process happens?

It will be the first device enumerated by iPXE, which will generally mean the lowest-numbered PCI device in the system.

You can find out various characteristics of the physical device by using the ${pci/....} settings. For example:

Code:
echo net0 has IDs ${pci/${net0/busloc}.0.2}:${pci/${net0/busloc}.2.2}

More examples available at http://ipxe.org/cfg/busloc.

Michael


RE: How does iPXE assign a network interface to net0? - Rickert - 2014-10-27 04:12

(2014-10-24 14:01)mcb30 Wrote:  It will be the first device enumerated by iPXE, which will generally mean the lowest-numbered PCI device in the system.

You can find out various characteristics of the physical device by using the ${pci/....} settings. For example:

Code:
echo net0 has IDs ${pci/${net0/busloc}.0.2}:${pci/${net0/busloc}.2.2}

More examples available at http://ipxe.org/cfg/busloc.

Michael
Thank you. I'm using .kkpxe build, and how does this image select device? Or is it the same across build images?

Do you know where in the source code this logic is written?


RE: How does iPXE assign a network interface to net0? - mcb30 - 2014-10-27 12:04

(2014-10-27 04:12)Rickert Wrote:  Thank you. I'm using .kkpxe build, and how does this image select device? Or is it the same across build images?

For undionly.kkpxe (where you are using the underlying PXE ROM rather than an iPXE native driver), iPXE can use only the network card which was used to load the undionly.kkpxe binary.

Michael


RE: How does iPXE assign a network interface to net0? - robinsmidsrod - 2014-12-03 15:25

Adding to mcb30's answer: It will also mean that you will only ever have one network interface when loaded with the UNDI driver, and that device will always be named net0.