testing a dhcp connection

Hi there,

I have a computers that has a fixed address :

terminal48:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 172.16.150.151
netmask 255.255.0.0
network 172.16.0.0
broadcast 172.16.255.255
gateway 172.16.100.3

I'd like to switch it to a dhcp address but before editing the file, I need to be sure it will be able to contact the dhcp server. Indeed, I can only remote control the computer (ssh) and have no physical access to it. If I edit the file, restart the networking and if the computer cannot get an dhcp ip address, I permanently loose control over it.

Is there a command that can test a dhcp connection without actually modifying the current parameters?

Thanks for your help

Santiago

Which OS are you using?
I would post this thread in the area of the OS you are using since this is really for scripts and other items.

If Solaris it will tell you if DCHP is enabled once you setup everything correctly and you can also bind a static IP to the adapter ie bge0:1 with a static so you can access it in case the DHCP does not take