How to find your IP address in linux

Question : How to find your IP address in linux ?

ipaddress

Answer: To find out the IP address of your linux system ,  ifconfig command is used .

Example:

# ifconfig

Output:

eth0      Link encap:Ethernet  HWaddr f2:3c:91:ae:e7:5b
 inet addr:192.168.1.5  Bcast:192.168.1.5  Mask:255.255.255.0
 inet6 addr: 2a01:7e00::f03c:91ff:feae:e75b/64 Scope:Global
 inet6 addr: fe80::f03c:91ff:feae:e75b/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 RX packets:9201258 errors:0 dropped:0 overruns:0 frame:0
 TX packets:3941260 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:9203759869 (9.2 GB)  TX bytes:1468954519 (1.4 GB)
 Interrupt:48 
lo        Link encap:Local Loopback
 inet addr:127.0.0.1  Mask:255.0.0.0
 inet6 addr: ::1/128 Scope:Host
 UP LOOPBACK RUNNING  MTU:16436  Metric:1
 RX packets:612076 errors:0 dropped:0 overruns:0 frame:0
 TX packets:612076 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0
 RX bytes:714457292 (714.4 MB)  TX bytes:714457292 (714.4 MB)

If you know the network interface name , you can use the command with the interface name as argument .

Example:

# ifconfig eth0

Output:

eth0      Link encap:Ethernet  HWaddr f2:3c:91:ae:e7:5b
          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: 2a01:7e00::f03c:91ff:feae:e75b/64 Scope:Global
          inet6 addr: fe80::f03c:91ff:feae:e75b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9201598 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3941530 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9203788907 (9.2 GB)  TX bytes:1469047919 (1.4 GB)
          Interrupt:48



Leave a Reply

Your email address will not be published. Required fields are marked *