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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-29-2007, 10:03 AM
|
#1
|
LQ Newbie
Registered: Oct 2007
Posts: 4
Rep:
|
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?
|
|
|
10-29-2007, 10:26 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
10-29-2007, 10:26 AM
|
#3
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
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
|
|
|
10-29-2007, 10:52 AM
|
#4
|
Member
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528
Rep:
|
sudo ifconfig -a
|
|
|
10-29-2007, 10:58 AM
|
#5
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
|
|
|
10-29-2007, 01:13 PM
|
#6
|
LQ Newbie
Registered: Oct 2007
Posts: 4
Original Poster
Rep:
|
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.
|
|
|
10-29-2007, 06:42 PM
|
#7
|
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:
|
hmm, could be a problem due to the virtual environment. is linux your host or your guest system?
|
|
|
10-30-2007, 03:09 AM
|
#8
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
10-30-2007, 05:02 AM
|
#9
|
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:
|
Quote:
Originally Posted by iron_toupee
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?
|
|
|
All times are GMT -5. The time now is 12:33 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|