Dhcp in use or not for Linux machine

Hi All.

Can anyone let me know the smartest and fullprrof method of checkking whther any given linux machine is using DHCP or not?

 
# ps -ef | grep dhcp

gives output like below :

root      3251  3128  0 11:02 pts/0    00:00:00 grep dhcp

so i dont think its full proof method , please suggest

I'm assuming you want to know if the server is using dhcp address or not? If so, you can grep for dhclient or even you can check /etc/sysconfig/network-scripts/ifconfig-interfacename for BOOTPROTO=dhcp on Redhat.

There isn't a foolproof method. The question "is my network device set dhcp" doesn't make sense, because a network device doesn't have a "DHCP" setting. So the question is: "Was eth0 set to 192.168.0.107 by static settings, or did dhcp do it?"

So you have to know where a distribution gets its settings to answer that question.

This is a continuation of the thread:

Dhcp in use or not on Solaris machine | Unix Linux Forums | Solaris

(or moreover the thread that morphed into what this thread might have been!) As such, I'll close this one.