LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-30-2010, 06:35 AM   #1
pepe0121
LQ Newbie
 
Registered: Jun 2007
Posts: 7

Rep: Reputation: 0
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.
 
Old 08-30-2010, 07:11 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
Code:
cat /etc/network/interfaces | grep dhcp
 
Old 08-30-2010, 07:30 AM   #3
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Rep: Reputation: 55
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
 
Old 08-30-2010, 09:32 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,258

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Re RH soln;

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

would be simpler
 
Old 09-01-2010, 01:10 PM   #5
pepe0121
LQ Newbie
 
Registered: Jun 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you for your help!
 
Old 09-01-2010, 02:25 PM   #6
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Rep: Reputation: 34
Also how can I see the dchp ip address through ifconfig command

Thanks
 
Old 09-01-2010, 04:26 PM   #7
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP on two interfaces (beginner) mesh2005 Linux - Server 6 08-20-2009 12:42 AM
Debian, dhcp, and 2+ network interfaces chrisrees Linux - Newbie 3 02-15-2008 04:39 AM
Serving dhcp on two interfaces eirkeim Linux - Networking 3 09-26-2006 08:37 AM
Manually specify network interfaces for DHCP NetAX Linux - Networking 1 04-22-2004 05:03 AM
Virtual network interfaces that use dhcp titakker Linux - Networking 1 09-23-2003 01:10 AM


All times are GMT -5. The time now is 01:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration