LinuxQuestions.org
Visit Jeremy's Blog.
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 10-29-2007, 10:03 AM   #1
iron_toupee
LQ Newbie
 
Registered: Oct 2007
Posts: 4

Rep: Reputation: 0
how do i find my IP address in DHCP?


when i put my ubuntu 7.04 into DCHP mode it shows no IP address when i do an ifconfig -a command.

what is the best way for me to determine my IP address in DHCP in bash shell?
 
Old 10-29-2007, 10:26 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
if it doesn't show on, then you don't have one... regardless of how an ip address is assigned, ifconfig works exactly the same.
 
Old 10-29-2007, 10:26 AM   #3
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Ummm, are you sure you can't see the IP in ifconfig?

If the interface has an address, ifconfig will show it. Could you maybe post the output from 'ifconfig -a'?

Dave
 
Old 10-29-2007, 10:52 AM   #4
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 59
sudo ifconfig -a
 
Old 10-29-2007, 10:58 AM   #5
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Try:
Code:
/sbin/ifconfig -a
Dave
 
Old 10-29-2007, 01:13 PM   #6
iron_toupee
LQ Newbie
 
Registered: Oct 2007
Posts: 4

Original Poster
Rep: Reputation: 0
yes i am sure that the IP is not listed along with the other interface information.

i am working within a virtual machine in vmware server and i notice that i have to switch from bridged mode back to custom bridged mode when trying to boot to a static IP. after i reboot enough times it comes up with the correct ip and is reachable. in DHCP mode i cant tell what it is doing. all i know is that when it comes up in DHCP mode there is no IP listed with the rest of the ip settings. this must mean that DHCP is not setting my ip address.

i was just wondering if there was a netcat command or some other tool that i could use to determin the ip that i've been assigned.

if you all are correct, i DHCP is not even assigning me one.

i will try and post my exact ifconfig -a results asap.

thanks to all.
 
Old 10-29-2007, 06:42 PM   #7
seelenbild28
Member
 
Registered: Oct 2005
Location: Germany, Berlin
Distribution: SuSE Linux 9.1/9.2/9.3/10.0/10.1, openSuSE 10.2, 10.3, Slackware, Debian, Redhat, BSD
Posts: 315

Rep: Reputation: 30
hmm, could be a problem due to the virtual environment. is linux your host or your guest system?
 
Old 10-30-2007, 03:09 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
virtual machines can't affect this, that would taint virtual machines at the base level... the host operating system and the network stack inside it, should have no idea whatsoever that it's actually not on a physical machine. it seems pretty clear that there is no ip assigned, maybe suggesting some sort of vmware bridging issue if the host pc is getting dhcp just fine.
 
Old 10-30-2007, 05:02 AM   #9
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Rep: Reputation: 30
Quote:
Originally Posted by iron_toupee View Post
yes i am sure that the IP is not listed along with the other interface information.

i am working within a virtual machine in vmware server and i notice that i have to switch from bridged mode back to custom bridged mode when trying to boot to a static IP. after i reboot enough times it comes up with the correct ip and is reachable. in DHCP mode i cant tell what it is doing. all i know is that when it comes up in DHCP mode there is no IP listed with the rest of the ip settings. this must mean that DHCP is not setting my ip address.

i was just wondering if there was a netcat command or some other tool that i could use to determin the ip that i've been assigned.

if you all are correct, i DHCP is not even assigning me one.

i will try and post my exact ifconfig -a results asap.

thanks to all.
do :
Code:
su
(password)
dhcpcd ethX #(replace X by the interface which contacts your dhcp server 0..n)
ifconfig ethX #(same X offcourse)
exit
and you'll see the new address.
after you succed getting ip, a little script that parse it is easy, for me (a hardcoded noobie script though) is :
Code:
ifconfig eth1 | head -2 | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1
would give me : 192.168.0.201


easy, right?
 
  


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
Single DHCP server ,to provide the ip address to a MAC address in two different subne alix123 Linux - Software 5 05-08-2007 11:16 PM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
How do I find my DHCP server address paradoxlight Linux - Networking 3 03-24-2003 11:10 PM
How to find out my IP address on a DHCP IP Assigned machine? simonh Linux - Networking 2 12-10-2002 05:49 AM
DHCP cannot find IP Address dbs Linux - Networking 3 10-04-2002 10:43 PM

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

All times are GMT -5. The time now is 12:33 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