LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-31-2003, 10:50 PM   #1
daemon_14
Member
 
Registered: Jul 2003
Location: Mesa, AZ
Distribution: CentOS 5 (Cisco Apps), Ubuntu Server (8.10), Ubuntu Desktop (8.10)
Posts: 46

Rep: Reputation: 15
Finding IP address...


Hello all:

I was wondering if there is a way that i can determine my RH9 box's IP address when i am using a DHCP connection. i know that in the world of windows, you can enter the command "ipconfig" (for the NT base) or "winipcfg" (for the 98 base). is there a command similar to this in the linux world?
also, with this, do i need to enter it in the hosts portion of the network config (along with the loopback)? also, if i must, is there a way that i can have it set to look at the DHCP settings of the interface?

thanks,
daemon
 
Old 08-31-2003, 10:54 PM   #2
65_289
Member
 
Registered: May 2002
Distribution: Ubuntu 5.04, Kanotix
Posts: 163

Rep: Reputation: 30
To find your IP address, run "ifconfig" and look for the name of the interface. Assuming you just have 1 network card, it should be "eth0"
 
Old 08-31-2003, 10:57 PM   #3
dcoder
LQ Newbie
 
Registered: Aug 2003
Location: Valemount BC
Distribution: Mandrake 9.1 (desktop) Debian (server)
Posts: 10

Rep: Reputation: 0
Hi

You can open a Konsole and type su for root and once root type ifconfig. This should give you something like:

eth0 Link encap:Ethernet HWaddr 00:10:4B:6B:1F:A6
inet addr:10.0.0.118 Bcast:10.0.0.255 Mask:255.255.255.0

Plus a lot more....

Hmmm... not sure I understand your second question, maybe someone else will.
 
Old 08-31-2003, 11:02 PM   #4
slapNUT
Member
 
Registered: Jun 2001
Location: Recycle Bin
Distribution: Linux & Everything else on VirtualBox
Posts: 144

Rep: Reputation: 15
Put this in your .bashrc file then you just type ip to find out what it is.

Code:
function ip() # get my IP
{
    MY_IP=$(/sbin/ifconfig eth0 | awk '/inet/ { print $2 } ' | sed -e s/addr://)
echo "ETH0 IP = $MY_IP"
}
<edit> You can change that to ppp0 if you are using a dial-up connection.

Last edited by slapNUT; 08-31-2003 at 11:05 PM.
 
Old 08-31-2003, 11:57 PM   #5
bblank
LQ Newbie
 
Registered: Aug 2003
Location: Overland Park, KS
Distribution: RedHat 9.0 (Shrike), RedHat 8.0 (Psyche), FreeBSD, OpenBSD, Solaris 7-9 SPARC
Posts: 18

Rep: Reputation: 0
To answer your second question, no modification of the hosts file is necessary.
 
  


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
Finding Ip address with Mac address rupeshdwivedi Linux - Networking 6 09-01-2005 07:44 AM
finding the address bruse Linux - Newbie 4 02-16-2005 11:14 AM
Finding a MAC Address bigrig2004 Linux - Networking 1 01-10-2005 07:21 PM
Finding IP Address [WebCarnage] Linux - Networking 3 03-07-2004 06:41 PM
finding local IP address flynnhandley Linux - Software 2 10-08-2003 04:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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