Search code examples
centosip-addresscentos7

Know CentOS7 IP address


I just installed CentOS on my VM, I want to know his IP address to be able to connect.

When I'm doing ip addr:

I get this:

[root@localhost]# ip addr
1: lo:  <LOOPBACK, UP, LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
   valid_lft forever preferred_lft forever
2: eth0: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 42:01:0a:f0:7e:a4 brd ff:ff:ff:ff:ff:ff

My IP address is not displayed.


Solution

  • You can use

    make sure your system connect with network

    # ip address show
    OR SIMPLY
    # ip a s
    

    However, it is still possible to use the old-fashioned ifconfig command. Thus our objective is to install ifconfig on CentOS 7 Linux which is a part of net-tools package.