You could manually and termporarily get an dynamic ip address from dhcp server like this:

dhclient eth0; # renew dhcp lease, ask for dhcp address, where eth0 is probably the nic you want

The /etc/sysconfig/network file should contain the following line:

NETWORKING=yes

The NETWORKING variable must be set to yes if you want networking to start at boot time.

The /etc/sysconfig/network-scripts/ifcfg-eth0 file should contain the following lines:

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

A configuration file is needed for each device to be configured to use DHCP.

credits: https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-dhcp-configuring-client.html

admin