How to Find a Machine's IP Address in CentOS 7

Posted in Useful Technical Tips on Mar 03, 2016

I was recently creating a virtual machine and installing CentOS 7, when I realized that I needed the ip address of the machine for a certain task. In CentOS 7, it's really easy to get the ip address - here is the command:

ip addr

In this case, the command returned the following:

1: lo:  mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno16777736:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:c0:60:f8 brd ff:ff:ff:ff:ff:ff
    inet brd scope global dynamic eno16777736
       valid_lft 1029sec preferred_lft 1029sec
    inet6 fe80::20c:29ff:fec0:60f8/64 scope link
       valid_lft forever preferred_lft forever

The ip address that I was looking for was right there:

This is useful if you're trying to set up a local web server for testing or development.

Yossi Wolfe: Web Developer | Entrepreneur | Tech Constultant

Posted on Jan 01, 2016

Hi, my name is Yossi Wolfe.

Cooking, traveling and photography are where my passions lie.

I've been known to delve into some serious web development, mostly PHP & MySQL.

Feel free to reach out to me if you want to chat.