LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 08-14-2008, 08:14 AM   #1
stuart_cherrington
Member
 
Registered: Aug 2008
Location: Get back in your Cube Unix Boy!
Distribution: rh5, oel5, debian etch, solaris
Posts: 228

Rep: Reputation: 36
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.)

If in the Kickstart config I have:

network --device eth0 --bootproto static --ip 194.117.142.153 --netmask 255.255.255.0 --gateway 194.117.142.2 --nameserver 194.117.142.83 --hostname kickclient

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.

Hope you guys can help

Stuart.
 
Old 08-14-2008, 04:12 PM   #2
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Rep: Reputation: 31
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.
 
Old 08-14-2008, 04:44 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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.
 
Old 08-15-2008, 02:45 AM   #4
stuart_cherrington
Member
 
Registered: Aug 2008
Location: Get back in your Cube Unix Boy!
Distribution: rh5, oel5, debian etch, solaris
Posts: 228

Original Poster
Rep: Reputation: 36
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 :-)
 
Old 08-15-2008, 06:14 AM   #5
stuart_cherrington
Member
 
Registered: Aug 2008
Location: Get back in your Cube Unix Boy!
Distribution: rh5, oel5, debian etch, solaris
Posts: 228

Original Poster
Rep: Reputation: 36
Have come up with a 4th alternative.

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.
 
Old 10-29-2009, 12:39 PM   #6
thebitshifter
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Rep: Reputation: 1
This command doesn't seem to work

Quote:
Originally Posted by trickykid View Post
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.

-mdg
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL5 kickstart config file creation problem rado_dimitrov Linux - Enterprise 2 02-13-2008 09:50 AM
Howto Assign Multiple Static Public IP Addresses under SBC's PPPoE Static Ip system o trekgraham Linux - Networking 8 04-17-2007 10:51 AM
MBR location specified in kickstart config file owenh Linux - General 2 03-22-2005 05:06 PM
where is torsmo's default config file? Godsmacker777 Linux - Software 4 03-07-2005 09:38 PM
a working default config file for 2.6 demmylls Linux - General 9 12-25-2003 11:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 08:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration