Sunday, November 21, 2010

How to find the IP address of a linux machine?

To find out IP address of Linux/UNIX/BSD/Unixish system you need to use command called

ifconfig.

It is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed. If no arguments are given to ifconfig command it displays the status of the current active interfaces. It displays Ethernet IP address, Mac address, subnet mask and other information. Type /sbin/ipconfig command to display IP address:


$ /sbin/ifconfig

OUTPUT:

eth0     Link encap:Ethernet  HWaddr 00:0F:EA:91:04:07
  inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
 
In above example 192.168.1.2 is IP address of eth0 Ethernet interface.
 

No comments:

Post a Comment