2015-10-22, 23:22
I'm trying to enumerate interfaces from within iPXE. I figured I could loop through each one doing "dhcp net${i}", then looking for info on the NIC like "${netX/dhcp-server}" and finally closing the interface with "ifclose net${i}".
I would like to skip over the interface that iPXE used when initially booting. The problem is I'm not seeing a way to get the name or even index of the current interface. Something like "${netX/ip}" except "${netX/index}" which returns "net0" for example.
Anything like this available that I'm just not seeing?
Second problem is there is the possibility that in our setup iPXE might be waiting around on a menu screen and intermittently checking an HTTP server for any boot instructions. Since iPXE doesn't have anything built into renew it's DHCP address before it's lease expires I figured I could do "dhcp net0" (also needs the index above) which seems to renew it just fine.
The problem with this is after doing that it seems to break being able to do relative paths in scripts. The reason we need to renew is I don't want the DHCP server to hand out another lease with the same IP.
Some psuedo code of what a script might look like for the interface enumeration http://pastebin.com/TRnAMkR5.
I would like to skip over the interface that iPXE used when initially booting. The problem is I'm not seeing a way to get the name or even index of the current interface. Something like "${netX/ip}" except "${netX/index}" which returns "net0" for example.
Anything like this available that I'm just not seeing?
Second problem is there is the possibility that in our setup iPXE might be waiting around on a menu screen and intermittently checking an HTTP server for any boot instructions. Since iPXE doesn't have anything built into renew it's DHCP address before it's lease expires I figured I could do "dhcp net0" (also needs the index above) which seems to renew it just fine.
The problem with this is after doing that it seems to break being able to do relative paths in scripts. The reason we need to renew is I don't want the DHCP server to hand out another lease with the same IP.
Some psuedo code of what a script might look like for the interface enumeration http://pastebin.com/TRnAMkR5.