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


  Search this Thread
Old 08-31-2003, 10:50 PM   #1
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?

Old 08-31-2003, 10:54 PM   #2
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
LQ Newbie
Registered: Aug 2003
Location: Valemount BC
Distribution: Mandrake 9.1 (desktop) Debian (server)
Posts: 10

Rep: Reputation: 0

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: Bcast: Mask:

Plus a lot more....

Hmmm... not sure I understand your second question, maybe someone else will.
Old 08-31-2003, 11:02 PM   #4
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.

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
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.


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 > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration