How to specify the DHCP IP address ? (CentOS 5.3)

centos5dhcp

I would like to shorten the bootup time of my CentOS Virtual Machines. They are spawn up automatically during our test cycle. We noticed that it could take up to 15 seconds to obtain an IP address from the DHCP server, and suspect it has to do with the DHCP broadcast discovery.

How do I hardcode the ip address of the DHCP server in CentOS 5.3 ?

[edit]
I noticed that the dhclient man page has the "-s" options which allows to specify the exact DHCP IP address. However that does not affect the boot cycle of the VM.

Best Answer

Now that I've found out something about dhclient options, I took a look at /etc/sysconfig/network-scripts/ifup-eth. In the very worst case, you can edit that script to run dhclient with the -s option to specify the DHCP server.

There's also an optional /etc/dhclient.conf file, but looking at man dhclient.conf I don't see any option that corresponds to the "-s" command line switch.