determining the machines local ip address

Rick Stevens rstevens at vitalstream.com
Mon Mar 8 17:53:14 UTC 2004


M.Hockings wrote:
> Dear Red Hat Linux Guru's at large...
> 
> This is probably more of a Linux question than strictly a RH9 question 
> but I wasn't able to find a solution by Googlin'...
> 
> What is an easy way to display the local machine's ip address?  Not the 
> loopback address (127.0.0.1) and not the external address (I can get 
> that with a Web page) but eth0's address on the current LAN.  For 
> example at home I'd expect to see something like 192.168.1.x.

The easist way is to use "ifconfig eth0" (or, as a regular user,
"/sbin/ifconfig eth0") and assuming you're using ethernet rather than
a dialup or DSL-over-USB.  In the latter case, you can use "ppp0"
rather than "eth0" or simply "ifconfig -a" or "/sbin/ifconfig -a" to
list ALL interfaces.

If you want to know what your IP is as seen by the rest of the world,
try "http://www.rhil.net/whatip.php".  It'll tell you.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-                   To err is human, to moo bovine.                  -
----------------------------------------------------------------------





More information about the Redhat-install-list mailing list