2

What can an IP address be assigned to?

  • A network interface, which is what I thought originally. (I seem to hear a network interface can have multiple IP addresses assigned to it, and if it is true, it doesn't affect that a IP address can be assigned to a network interface.)
  • nothing, which is what I seem to hear https://unix.stackexchange.com/questions/508007/when-does-an-ip-address-not-need-to-be-assigned-to-a-network-interface where all loopback IP addresses (except 127.0.0.1) can work (be communicated with) without being assigned to network interface(s).
  • A host or network, which is implied by DNS resolution, and also by some sentences from Tanenbaum's Computer Network

    The IP address 0.0.0.0, the lowest address, is used by hosts when they are being booted. It means this network or this host.

    The address consisting of all 1s, or 255.255.255.255—the highest address—is used to mean all hosts on the indicated network.

Must a public IP address be assigned to a network interface?

Must a private IP address (i.e. 10.0.0.0 – 10.255.255.255/8, 172.16.0.0 – 172.31.255.255/12, 192.168.0.0 – 192.168.255.255/16) be assigned to a network interface?

Can a public IP address be assigned to more than one network interface?

Can a private IP address be assigned to more than one network interface?

Thanks.

Ron Maupin
  • 99,565
  • 26
  • 120
  • 195
Tim
  • 1,545
  • 15
  • 27
  • 2
    You seem to be hung up on public vs private addresses. Computers don't know if an address is public or private -- it makes no difference to them. Only people have agreed that certain addresses won't be routed on the public Internet, and therefore do not have to be unique. – Ron Trunk Mar 24 '19 at 00:10

1 Answers1

6

IP addresses are assigned to interfaces, either physical or virtual. For example, for a physical interface, such as a NIC, or a virtual interface, such as a loopback or SVI.

Some people think IP addresses are assigned to hosts, but they are assigned to the interfaces of hosts, and a host can have multiple interfaces, each having an IP address (maybe more than one IP address per interface).

Networks are concepts. They represent a group of IP addresses with the same network as defined by their masked addresses (see this two-part answer for how that works). You do not assign an IP address to a network because there is nothing to which you can assign the address.

Can a public IP address be assigned to more than one network interface?

Can a private IP address be assigned to more than one network interface?

Each interface gets a different IP address. There is nothing in IP to distinguish public or private addresses. To IPv4 they are all the same type of address. The Private addresses are artificial, and it is simply that the ISPs have agreed to not route those address ranges. (IPv6 has no concept of Private addresses.)

Ron Maupin
  • 99,565
  • 26
  • 120
  • 195