0

So I issued a command ip a which list all the IP addresses. However I don't understand what all the other Ip addresses and details it printed. In this output I just understood that inet W.X.Y.Z/20 brd is my machine's IP address under eth0. What about the IP address and details under lo and eth1. From one of the blog I understood that inet A.B.C.D/16 brd is my private address but none of them explains what other things are.

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    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 fq_codel state UP group default qlen 1000
    link/ether 52:10:9f:10:ad:10 brd ff:ff:ff:ff:ff:ff
    inet W.X.Y.Z/20 brd W.X.79.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet A.B.C.D/16 brd A.B.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2400:abab:100:ab::ab:5001/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::abab:9fff:abab:add2/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 9a:ab:ab:40:13:a5 brd ff:ff:ff:ff:ff:ff
    inet Q.W.E.R/20 brd Q.W.15.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 f56g::abab:a5ff:abab:13c5/64 scope link
       valid_lft forever preferred_lft forever

EDIT: Updated the actual result of ip a

root@ubuntu-s-1vcpu-1gb-blr1-01:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    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 fq_codel state UP group default qlen 1000
    link/ether 52:a0:9f:54:ad:d2 brd ff:ff:ff:ff:ff:ff
    inet 139.59.75.106/20 brd 139.59.79.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.47.0.5/16 brd 10.47.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2400:6180:100:d0::db:5001/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::50a0:9fff:fe54:add2/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 9a:4b:a5:40:13:c5 brd ff:ff:ff:ff:ff:ff
    inet 10.122.0.2/20 brd 10.122.15.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::984b:a5ff:fe40:13c5/64 scope link
       valid_lft forever preferred_lft forever

1 Answer 1

3

You don't have "the one ip". Every network interface in your machine can have multiple IPs. A machine has usually one or two network interfaces. You have three.

lo

This is your loopback device, this is (with exceptions) always there. It is the interface that your machine uses when it wants to talk to itself (127.0.0.1).

eth0 & eth1

It seems that you have two more interfaces. Every one of these can have multiple ip addresses. The IPs you are referring to (X.X.X.X/XX) are IPv4 addresses. The other ones (e.g. 2400:abab:100:ab::ab:5001/64) are IPv6 addresses. If you want further information about these, I suggest you read the Wikipedia articles on both, they are quite extensive and well writen.


My guesses regarding your IPs (without knowing what the actual IPs are):

127.0.0.1     IPv4 localhost (not a guess)
::1/128       IPv6 localhost (not a guess)
W.X.Y.Z/20    Maybe your actual public ip. Some ISPs do that (although it's dumb)
A.B.C.D/16    probably your local private IPv4. Probably a 10.0.X.X address
2400:abab:    Your public IPv6 address. This is mostlikly a public routed IP
fe80:...      Your private IPv6 (The IPv6 equvalent of A.B.C.D/16)
Q.W.E.R/20    no idea without knowing what the actual IP is
f56g::abab:   Again probably a public routed IPv6
11
  • My question was not if they are IPv4 or IPv6 address, my question what are they and what are they used for and obviously I don't just have 2 IP addresses in that list, there are multiple addresses there! May 12 at 7:00
  • Oh sorry, it seems I understood your question the wrong way. I still sugget you looking up on the IPv4 and IPv6 wikipedia article, as your questions will probably be partially answered there. I will still edit my answer and add my guesses there.
    – Malik
    May 12 at 7:06
  • My guesses regarding your IPs (without knowing what the actual IPs are): No one is going to expose their actual P/P IPs here! May 12 at 7:42
  • 2
    1. The private IP of someone is really irellevant. For example my private ip is currently 192.168.178.41. There you go, what are you going to do with this now? 2. OP could anonymize is public ips. For example 185.213.XXX.XXX This way, we know what kind of IP it is, without actually knowing the IP.
    – Malik
    May 12 at 7:45
  • For public IP addresses you can just use one from the "example" IP subnets referenced in RFC 5737, for instance 192.0.2.42.
    – dr_
    May 12 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.