LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-26-2002, 07:07 PM   #1
Krash
LQ Newbie
 
Registered: Jul 2002
Posts: 2

Rep: Reputation: 0
Dectect IP Address?


I just installed Slackware 8.0. I selected DHCP for my netconfig option dealy. It works, i can use lynx to browse around. Is there a way though that i can figure out what IP i've managed to pull down and use?
 
Old 07-26-2002, 07:11 PM   #2
sarin
Member
 
Registered: May 2001
Location: India, Kerala, Thrissur
Distribution: FC 7-10
Posts: 354
Blog Entries: 2

Rep: Reputation: 34
Try
/sbin/ifconfig
this will show all the network interfaces and associated ips on your m/c
--Sarin
 
Old 07-26-2002, 07:17 PM   #3
Krash
LQ Newbie
 
Registered: Jul 2002
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you greatly, that worked perfectly
 
Old 07-30-2002, 11:45 PM   #4
rkblk1
LQ Newbie
 
Registered: Jul 2002
Location: North New Jersey
Posts: 4

Rep: Reputation: 0
Wink Find Your IP

Log on to no-ip.com from your linux box and look for what is my ip it will tell you your ip.
 
Old 07-31-2002, 03:30 AM   #5
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
If you are using dhcpcd then a file called /etc/dhcpc/dhcpcd-eth?.info should be created with all the information that was received from the dhcp server. The question mark will be replaced with the number of the interface which is receiving it's ip address with dhcp.

I usually use the following command in my scripts to get my ip:

export `grep IPADDR /etc/dhcpc/dhcpcd-eth?.info`
The ip will then be stored in the variable IPADDR.

Ofcourse that will only work if you have one interface that receives it's ip through dhcp. But you can always replace the ? with the appropriate number.
 
Old 07-31-2002, 01:43 PM   #6
linuxRules
Member
 
Registered: May 2002
Distribution: Rehdat 7.3
Posts: 49

Rep: Reputation: 15
I am tried that in my .profile running ksh and it doesn't seem to
work. I put that entry in the .profile and then ran it -
it spit out all the shell variables and has that line in the
output.

grep IPADDR /etc/dhcpc/dhcpcd-eth?.info

On the command line it works fine.
What am I doing wrong or not doing.
Thanks.

Ron
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
API for mapping Physical Address to Virtual Address Lakshman_smt Linux - Software 2 10-15-2006 09:08 PM
dhcp no ip address and netmask dont match route address pengy666 Linux - Wireless Networking 1 05-08-2005 09:33 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
problem to print source address and destination address jooboo Programming 2 11-26-2003 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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