Static IP addresses supplied through default kickstart config file?
Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Static IP addresses supplied through default kickstart config file?
Hi,
I'm attempting to build 100+ servers with RedHat 5.1. I need the IP address (netmask etc) to be statically applied to each server as its built (or possibly getting the same IP information from a DHCP server.)
then obviously I have a static IP installed on the system.
Without having 100+ config files, how do I apply a static IP to each host? I've thought about writing a wrapper script which 'sed's the config file into the correct format, but this still means 100+ config's would get created eventually.
You'll need to define this on a DHCP server that will give out the IP by MAC address. You could also do some wild scripting in the %pre section using the scripting lang of your choice to determine what IP it should have, and write that to the appropriate config file on the destination system.
I believe you can specify these from the boot: prompt when you kick off the kickstart. Unless you're using PXE though to kick it off, you'd need it in the ks.configs unless you wrote some fancy scripting.
But if you can get the MAC Addresses, I'd just set these up as statically assigned within your DHCP server like mentioned before, so they always get the same address. I know I wouldn't want to type out:
boot: linux ks=<mykickstart-location> --bootproto=eth0 --device=eth0 --ip=111.111.111.111 --gateway=111.111.111.1 --netmask=255.255.255.0 --nameserver=111.111.111.110 --hostname=myhost
100 or more times. At least to my knowledge it retains this info if passed at the boot prompt to kick off the kickstart, I'm testing now on a virtual machine to make sure.
Thanks for your help so far. I am booting each host from PXE, so this does make life a little harder for me but easier for the Ops (who do the building)
It seems to boil down to 2 options:
1. Write a section in the %pre which extracts the IP address from DNS? but how I get this information without a hostname already being defined is a tricky one!
2. Make the servers run DHCP and have the dhcpd.conf defined for 100+ servers, this seems to make more sense than allowing 100+ config files but it does mean that we have to get our Ops team to edit the dhcpd.conf everytime they want to add extra servers, and we all know that Ops and Vi don't mix!
Actually another option occured to me on the way in today, I could try using Solaris Jumpstart with the Kickstart JET installed, but I don't know if this assigns Linux IP's from the /etc/ethers file (as with Solaris) or if they are embedded in the config file! I suppose that's next weeks outlined already :-)
Have the system boot from dhcp, but then write the network information to the eth files as part of the %post, this will ensure the IP is then static and the dhcp server is not required 24x7.
Now all I need to do is get the darn client to pick up its DHCP address, currently it refuses to do this.
I believe you can specify these from the boot: prompt when you kick off the kickstart. Unless you're using PXE though to kick it off, you'd need it in the ks.configs unless you wrote some fancy scripting.
But if you can get the MAC Addresses, I'd just set these up as statically assigned within your DHCP server like mentioned before, so they always get the same address. I know I wouldn't want to type out:
boot: linux ks=<mykickstart-location> --bootproto=eth0 --device=eth0 --ip=111.111.111.111 --gateway=111.111.111.1 --netmask=255.255.255.0 --nameserver=111.111.111.110 --hostname=myhost
100 or more times. At least to my knowledge it retains this info if passed at the boot prompt to kick off the kickstart, I'm testing now on a virtual machine to make sure.
Passing the options that you show here doesn't seem to set the network options in the built system.
At home I am a slackware user, so I do not have a whole lot of experience with kickstart.
I have a kickstart that is being provided, and I need to document a procedure to install a system and configure it with a static network configuration and this, while sort of verbose at boot up, seems like an easy way configure this information without modifying any other scripts. Is there perhaps a typo in this? Does it not work on systems with multiple NICs? Any help would be appreciated.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.