LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to find out which interfaces use dhcp? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-find-out-which-interfaces-use-dhcp-829280/)

pepe0121 08-30-2010 05:35 AM

How to find out which interfaces use dhcp?
 
Hello all,

This may be a very basic question but I was wondering if there is a way through the command line to find out which interfaces are using dhcp. I'm using Ubuntu 9.10 in case that makes a difference.

Thank you in advance.

smoker 08-30-2010 06:11 AM

Code:

cat /etc/network/interfaces | grep dhcp

vinaytp 08-30-2010 06:30 AM

For Debian family of distros

Code:

cat /etc/network/interfaces | grep dhcp
For Redhat family of distros

Code:

find /etc/sysconfig/network-scripts/ -name "ifcfg-*" | xargs grep -i dhcp

chrism01 08-30-2010 08:32 PM

Re RH soln;

grep -i dhcp /etc/sysconfig/network-scripts/ifcfg*

would be simpler

pepe0121 09-01-2010 12:10 PM

Thank you for your help!

smilemukul 09-01-2010 01:25 PM

Also how can I see the dchp ip address through ifconfig command

Thanks

smoker 09-01-2010 03:26 PM

You can see the ip address with ifconfig, you can't see what defined the ip address without looking at the config file. (AFAIK)


All times are GMT -5. The time now is 04:10 AM.