How to check the IP address on linux machine if no ifconfig command is installed ?

Today we will see an interesting tip to see the IP address of a linux machine when no ifconfig utility is installed on server.

Issue: ifconfig command not available

[user@ngelinux02 /]$ ifconfig -a
ifconfig: Command not found.

 

Solution

I. Check in configuration

[user@ngelinux02 /]$ cat /etc/sysconfig/network-scripts/ifcfg-* | grep -i IP
IPADDR=10.209.198.193
IPV6INIT=no
IPADDR=127.0.0.1

 

II. Using Hostname Command

[user@ngelinux01 saket]$ hostname -I
172.23.90.98

 

III. Using nmcli if this is controlled by Network Manager

[root@ngelinux01 network-scripts]# nmcli -p dev
** (process:32036): WARNING **: nm_client_get_devices: error getting devices: The name org.freedesktop.NetworkManager was not provided by any .service files

==========================================
            Status of devices
==========================================
DEVICE     TYPE              STATE
------------------------------------------

[root@ngelinux01 network-scripts]# nmcli -p eth0 show
Error: Object 'eth0' is unknown, try 'nmcli help'.
[root@ngelinux01 network-scripts]#

Since on my system it is not configured with nmcli, hence it has not shown any output.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments