Wandering Thoughts archives

2006-06-14

How to supply an IP address in Red Hat's Kickstart

Ignoring DHCP, there are three ways to supply an IP address when you're using Kickstart to set up machines automatically:

  1. put a network line in your Kickstart file. You need to give all of the information (--hostname, --ip, --gateway, --netmask, --nameserver) and also use '--bootproto static'.
  2. put the information on the kernel command line, with ip=, gateway=, netmask=, and dns=. Non-DHCP is assumed in this situation, and you can't provide the hostname; instead it's taken from what the IP address reverse-maps to in the nameserver.
  3. force Anaconda to pause and ask you for the information, by putting 'ip=askme' on the kernel command line. (You don't actually need 'askme', just anything that isn't an IP address or 'dhcp'.)

The third option is undocumented but probably unlikely to break in the future, and sometimes quite handy.

The Kickstart process assigns the machine IP address very early on, before Anaconda has started and before the more sophisticated bits of the Kickstart file are evaluated. Thus, you can't have the IP address and suchlike generated by a %pre section.

From personal experience, syslinux is the only bootloader that lets you have a lot of boot entries and deal with them sensibly. LILO has a low hardcoded limit, and while Grub can theoretically deal with lots you'll have to scroll through a huge menu; with syslinux you can do things like have a generic USB key that will install any one of a hundred machines with the right IP address options just by typing its hostname.

(Disclaimer: this is all how it was in Fedora Core 4 (and earlier versions); I haven't tested FC5 to see if it changed anything.)

Sidebar: why not DHCP?

I don't like DHCP, because it is very rare that I want a machine's IP address to be assigned based on its Ethernet address. Far more common is things like lab situations, where I want machines to be given names based on their physical location. You can do this with DHCP, but you have to be careful to maintain what is effectively a table mapping physical location to Ethernet address, and I'm not convinced you get anything for the effort.

linux/KickstartIPAddresses written at 02:39:40; Add Comment


Page tools: See As Normal.
Search:
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.