Score:0

ip addr shows mutiple interfaces and multiple IPs... Which is the right IP address in the output?

pk flag

I just want to find my PC's IP address...

ip -c addr

I can't... For the life of me decypher what this output is...

19: eth0: <> mtu 1500 group default qlen 1
    link/ether a4:4c:c8:33:f1:9b
    inet 156.237.22.144/16 brd 169.254.255.255 scope global dynamic
       valid_lft forever preferred_lft forever
    inet6 fa70::7367:55cf:523b:8983/64 scope link dynamic
       valid_lft forever preferred_lft forever

15: eth1: <> mtu 1350 group default qlen 1
    link/ether 54:9e:4d:24:0c:03
    inet 156.237.1.39/16 brd 169.254.255.255 scope global dynamic
       valid_lft forever preferred_lft forever
    inet6 fa70::2dc9:23de:c83d:c4e4/64 scope link dynamic
       valid_lft forever preferred_lft forever

1: lo: <LOOPBACK,UP> mtu 1500 group default qlen 1
    link/loopback 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope global dynamic
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host dynamic
       valid_lft forever preferred_lft forever

4: eth2: <> mtu 1500 group default qlen 1
    link/ether 5e:02:e8:f8:cd:eb
    inet 156.237.195.47/16 brd 169.254.255.255 scope global dynamic
       valid_lft forever preferred_lft forever
    inet6 fa70::fdbb:5727:229a:3f59/64 scope link dynamic
       valid_lft forever preferred_lft forever

21: wifi0: <> mtu 1500 group default qlen 1
    link/ieee802.11 90:61:ae:94:c3:9e
    inet 156.237.109.138/16 brd 169.254.255.255 scope global dynamic
       valid_lft forever preferred_lft forever
    inet6 fa70::593d:675a:746e:222b/64 scope link dynamic
       valid_lft forever preferred_lft forever

8: wifi1: <> mtu 1500 group default qlen 1
    link/ieee802.11 92:61:ae:94:c3:9d
    inet 156.237.13.213/16 brd 169.254.255.255 scope global dynamic
       valid_lft forever preferred_lft forever
    inet6 fa70::607:e8cc:a9b9:afdd/64 scope link dynamic
       valid_lft forever preferred_lft forever

17: wifi2: <BROADCAST,MULTICAST,UP> mtu 1500 group default qlen 1
    link/ieee802.11 90:61:ae:94:c3:9d
    inet 192.168.100.16/24 brd 192.168.100.255 scope global dynamic
       valid_lft 258869sec preferred_lft 258869sec
    inet6 fa70::6ce8:1dc2:7a6:7ef6/64 scope link dynamic
       valid_lft forever preferred_lft forever

What are all these IP addresses? Which one is my PC?

19:  eth0:   156.237.22.144
15:  eth1:   156.237.1.39
1:   lo:     127.0.0.1
4:   eth2:   156.237.195.47
21:  wifi0:  156.237.109.138
8:   wifi1:  156.237.13.213
17:  wifi2:  192.168.100.16
st flag
What do you mean by "my PC's IP address"? PCs don't have IP addresses, network interfaces have IP addresses. What do you mean by "Which is the right IP address?" What is the criterion by which you decide that an IP address is "right"? What makes you think that any of those IP addresses are "wrong"?
Score:3
in flag

If the ip command is showing you seven IP addresses, then they are all for your computer. Your machine appears to have multiple ethernet and wireless interfaces all connected simultaneously, so let's go through them based on their IP ranges:

Interface IP Address Description
lo 127.0.0.1 This is a standard IP address to denote your current machine. This is its local address.
eth0 156.237.22.144 This is a public IP address managed by Cox Communications Inc.
eth1 156.237.1.39 This is a public IP address managed by UCN Cable Network Pvt. Ltd in India
eth2 156.237.195.47 This is a public IP address managed by DingFeng XinHui Technology Limited in Hong Kong
wifi0 156.237.109.138 This is a public IP address managed by Africa on Cloud in Saudi Arabia
wifi1 156.237.13.213 This is a public IP address managed by Cox Communications Inc.
wifi2 192.168.100.16 This is a private IP address managed by your home WiFi router

Because you have so many IP addresses associated with different devices, I'm going to assume that you're running one or more VPNs with the aim of obfuscating source traffic or circumventing geographic limitations imposed by some services online. This is not to be unexpected ... unless you are not intentionally running VPN software.

As for "I just want to find my PC's IP address", the answer depends on what you need to know the address for:

Intention IP Address
You are developing a website on your computer and want to see it in the browser 127.0.0.1
You want another device on your home network to connect to your PC 192.168.100.16

If you are looking for something else, be sure to update your question to provide as much specific detail as possible, as this makes answering a question correctly much easier

Ivan avatar
pk flag
That was awesome! Thank you so much! I am not using a VPN, I invented the addresses in order to not show the real ones. I apologize for the inconvenience, although I learned something by it. My goal is to find another ethernet device on the same network while I am on WIFI, and all the tutorials start with `ip addr` but **NONE** say how to interpret it smh.
Ivan avatar
pk flag
I've tried using my IP addresses in the geolocation tool you provided, and they all say they are **Bogon IP addresses**. Interesting.
Michael C. avatar
id flag
Did you see bogon if you visit https://www.ip2location.com?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.