How to find my own IP address in CentOS

- by

Two commands come to the rescue: ip and ifconfig. Either does the trick:

#ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 00:19:99:0D:D2:58  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::219:99ff:fe0d:d258/64 Scope:Link
          RX packets:14022830 errors:1 dropped:0 overruns:0 frame:1
          TX packets:17605482 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6842851425 (6.3 GiB)  TX bytes:22015650673 (20.5 GiB)
          Interrupt:225 Base address:0x2000 

Slightly more parameters with ip, and slightly less output:

#ip addr show eth0

2: eth0:  mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:19:99:0d:d2:58 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth0
    inet6 fe80::219:99ff:fe0d:d258/64 scope link 
       valid_lft forever preferred_lft forever

The output on the second line is the IP address (in our example

If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.