LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 05: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, 06:11 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

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

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, 08:32 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Re RH soln;

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

would be simpler
 
Old 09-01-2010, 12: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, 01: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, 03:26 PM   #7
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
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



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-19-2009 11:42 PM
Debian, dhcp, and 2+ network interfaces chrisrees Linux - Newbie 3 02-15-2008 03:39 AM
Serving dhcp on two interfaces eirkeim Linux - Networking 3 09-26-2006 07:37 AM
Manually specify network interfaces for DHCP NetAX Linux - Networking 1 04-22-2004 04:03 AM
Virtual network interfaces that use dhcp titakker Linux - Networking 1 09-23-2003 12:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:00 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
Open Source Consulting | Domain Registration