Adventures in PXE booting part 3»

So, in my quest to be able to network boot with a static IP, one issue that comes up a lot is passing the IP and other information to whatever I’m booting. It would be pretty annoying to have to enter the information once to get the boot menu, then again to boot whatever it is I wanted to boot. This seems like it should be pretty straightforward, however every operating system seems to have it’s own way of doing it. This gets even worse with the various LiveCD distributions (Clonezilla, GParted, RIPLinux, etc), as they inevitably have their own customized (undocumented) way of handling it, if they handle it at all.

So, to boot recent Debian-based operating systems and assign it an IP from iPXE, you need to append the following to the kernel command line:

ip=${net0/ip}::${net0/gateway}:${net0/netmask}:${net0/hostname}:eth0

For CentOS, you would use the following:

ip=${net0/ip} netmask=${net0/netmask} gateway=${net0/gateway} hostname=${net0/hostname}

For Clonezilla (which is Debian based, but doesn’t use the standard Debian way):

ip=eth0:${net0/ip}:${net0/netmask}:${net0/gateway}:8.8.8.8

If you have some software that indicates you should use ‘IPAPPEND 1’ from SysLinux, this really means you need to add this to the command line:

ip=${net0/ip}::${net0/gateway}:${net0/netmask}

Similarly, if you have something that says to use ‘IPAPPEND 2’, this is what you need:

BOOTIF=01-${net0/mac:hexhyp}

For that last one, I really don’t have any idea what the “01-” in front is for, but after examining the Anaconda (CentOS installer) source, something seems to be required there, and the installer happily ignores whatever you put.