Allow multiple IP stanzas in PXE / netboot
Hello,
The setup is like this:
PXE Server booting an Alpine Linux v3.19 - Netboot. Among the kernel parameters used is: ip=dhcp
. The problem is with devices that have two NICs, and just one is connected. It seems that the last NIC is always chosen, even if that NIC is unconnected. This gets me in a loop where DHCP requests are being continuously sent on an unconnected interface.
One way to solve this would be to allow multiple IP stanzas, in order to set the IP settings on a per interface basis. If the interface is missing, ignore that configuration, if the interface is present, apply the config. In case the interface is set to use DHCP, if DHCP fails, don't retry, as it will get into the same loop.
Another way to fix this would be to - before deciding which interface to use pick the last CONNECTED interface.
Screenshot provided for a better understanding of what's going on. VM has two NICs, eth0 is connected, eth1 is disconnected. Thank you.