How to Display IP Address on RHEL/CentOS

In this post, i will share the simple command to display the CentOS and Redhat Enterprise linux(RHEL) ip address. This command has been tested on Linux CentOS 5.8 server and may working on other CentOS and RHEL version as well. There are two alternative command to display ip address :

1. Display ip address using “ip address show” command :

[root@centos58 ~]# ip address show
1: lo:  mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
2: eth0:  mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:0c:29:a1:17:ad brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth0

2. Display the ip address using “ifconfig” command :

[root@centos58 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:A1:17:AD
          inet addr:  Bcast:  Mask:
          RX packets:72408 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64177 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:24607729 (23.4 MiB)  TX bytes:6678283 (6.3 MiB)
          Interrupt:75 Base address:0x2000

lo        Link encap:Local Loopback
          inet addr:  Mask:
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Leave a Reply

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