Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've modified a CentOS net install image to load my kickstart file over http. This works great when running on a network that has a DHCP server. Obviously, without DHCP this fails because the installer cant acquire an IP.

So, my question is what do I need to modify in order to set a static IP?

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

You will need to pass the static IP options to the kernel so that the kickstart process can locate your ks.cfg. As you know, by default the net install looks for a dhcp address. You can set a static address by passing at a minimum ip and optionally gw & dns at the boot prompt.

linux ks=http://192.168.0.1/ks.cfg ip=192.168.0.100 gw=192.168.254.254 dns=192.168.0.2

You can optionally specify the device to use in one of 5 ways.

ksdevice=<device>
  • the device name of the interface, for example, eth0
  • the MAC address of the interface, for example, 00:12:34:56:78:9a
  • the keyword link, which specifies the first interface with its link in the up state
  • the keyword bootif, which uses the MAC address that pxelinux set in the BOOTIF variable. Set IPAPPEND 2 in your pxelinux.cfg file to have pxelinux set the BOOTIF variable.
  • the keyword ibft, which uses the MAC address of the interface specified by iBFT

There are many many options you can pass for a kickstart boot. You can get a full list of the boot and kickstart script options for RHEL/CentOS 6 here.

share|improve this answer
    
Thanks! This is exactly what I needed. Do you know if you can also specify what device you want to use? –  Chris Charge Apr 27 '12 at 12:06
    
Sure can. See my edit. –  uther Apr 27 '12 at 12:30
1  
This is great info uther. I also really appreciate you linking to the RHEL documentation. I had googled around but never came across it. –  Chris Charge Apr 27 '12 at 13:09
add comment

There is some ways that on a CentOS system you can set IP addresses staticlly, I mention two of these:

1) using command-line:

/sbin/ifconfig eth1 192.168.30.40 netmask 255.255.255.0 broadcast 192.168.30.255

in this command you can set your intended static ip address in place of 192.168.30.40, netmask in place of 255.255.255.0 and broadcast in place of 192.168.30.255 .

2)GUI-based: enter the following command as root:

/usr/bin/neat

now you see a window, select the interface you want to set a static IP to it (e.g. eth0) then press the "Edit" key. now another window will open, in this one select "Staticlly Set IP Addresses" radio button, then fill "IP address", "Subnet Mask", "Default Gateway Address" fields as you want. then press OK to save changes.

share|improve this answer
    
Thanks for the extra info. I wasn't familiar with neat. Good to know. –  Chris Charge Apr 28 '12 at 19:42
2  
As I said its a GUI-based utility, no familiarity is needed, enter the above command, and set IP. –  XinHua Apr 29 '12 at 5:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.