8

I want to try doing a PXE install for the first time.

Every single tutorial I've read seem to indicate it requires a DHCP server configured to point to the TFTP server with the boot image. I don't understand why DHCP should be required though, isn't it possible to just manually configure computer's IP and network settings, and manually specify the IP where the TFTP server is located?

If not, is there any particular reason why you wouldn't be allowed to do this, or given a simple prompt in the pxe menu asking to manually specify the network path?

user142968
  • 91
  • 1
  • 1
  • 2

3 Answers3

5

A DHCP server gives the client the IP address, static route, DNS server, a filename to load, and the "next-server" name or IP to load it from, and other config details.

The problem is "where are you going to configure those details if not from DHCP"?

Does your BIOS give you that option, fields to enter those details? Most likely not.

You could create your own custom ROMs (e.g using ipxe) for certain NICs with this information hard-coded - but why? Not only would you have to make a unique individual ROM for each NIC (for the IP address), but hard-coded configuration details nearly always end up being a pain because details change and you need to be able to change them easily....which you can do with a DHCP or bootp server, simply by editing the dhcpd.conf

There's nothing preventing a PXE ROM from having a configuration menu (in fact, I have seen some servers with the ability to specify a NIC's IP address and some other details - mostly for remote management cards like Dell iDRAC and HP iLO and Sun LOM), but there is little incentive for manufacturers to do so - this is an already solved problem, and DHCP / bootp is the solution.

cas
  • 1
  • 7
  • 119
  • 185
  • Thanks for the answer. The configuration menu you mention is basically what I was looking for. It would be nice if when you select the onboard nic as your boot device, if it would give you a basic text menu letting you specify your IP and also the TFTP server location. But sounds like this is only available on very few cards. – user142968 Nov 22 '15 at 04:27
  • OK, let's say that the BIOS lets you set an IP address etc for a NIC....and successfully loads, say, `gpxelinux.0` from the configured next-server. Where does `gpxelinux.0` get it's network configuration from? The BIOS config is only valid while the BIOS code is running, and there's no way for that to persist from the BIOS to the next program run - it has to run a dhcp query or have the network config hard-coded somehow. you can see this yourself if you watch a network boot in progress, there will be multiple DHCP requests as each stage of the boot needs to get an IP address, etc. – cas Nov 22 '15 at 23:22
0

I had the same problem as you. I solved it with ipxe. pxe has to use ip, pxe doesn't mention the interactive interface, you have to use an alternative tool ipxe.

xiaodong
  • 101
  • 4
    Could you say a little bit more about ipxe? Where did you get it; how did you configure it; how did you use it to solve this problem? – Jeff Schaller Nov 01 '20 at 15:01
0

If you don't want to override an existing DHCP server, then setup a "proxyDHCP server". A popular proxyDHCP server is dnsmasq, which you can configure to only respond to PXEBoot requests. I found this out by reading the following SO post:

PXE do require DHCP.

PXE can run from a proxyDHCP server - which only provides the boot options needed, and does not give IP leases to any client.

The most common service for proxyDHCP under Linux is probably dnsmasq, the sample config file mentions most of what you need, My own experience is with iPXE and as a minimal config for that you could use https://ipxe.org/appnote/proxydhcp

If you have static IP assignment, and DHCP is not allowed, then using something like iPXE on USB could be an alternate option, (of course requires that USB is allowed, or an CD or similar)

Source: https://stackoverflow.com/a/70150865/7489488

ptk
  • 101
  • 1