5

Can one IP address be assigned to more then one device or interface? In which situations may this happen?

Can one device or interface posses more than one IP address?

7

Can one IP address be assigned to more then one device or interface? In which situations may this happen?

If you actually stopped to think this through, clearly this can happen. All you need to consider is all the consumer/CPE devices that default their management interfaces to an IP address something like 192.168.1.1.

Generally speaking, in a single local network (i.e. flat network or VLAN) a single IP address can only be assigned to one interface/device at any given time. The reason why is that other devices need to learn a correlation between a MAC address and an IP address. This is what the ARP process provides.

However like many general rules, there are exceptions and in this case these are normally mechanisms used to provide some sort of load balancing and/or redundancy.

Let's say you have two devices that both want to provide the same service on the local network. They could be programmed in a fashion where one responds to ARP for queries where the source MAC address is odd, and the other for even (or hashes or some other mechanism to group sources). This will allow the load to be distributed between the two.

If your two devices can then also maintain some sort of "heartbeat" and have the ability to "take over" the other device's MAC address in case of a failure, then you now also have a means of providing redundancy.

The presences of these capabilities and exactly how they work would be dependent on the features available in the device.

Can one device or interface posses more than one IP address?

Yes, however this capability will depend on the device/operating system in question. Some may provide this capability by allowing you to create multiple "virtual" interfaces of some sort tied to the interface or device. Others may allow multiple IP addresses on one interface. Or they may be able to do both.

Here are examples of virtual interfaces (Linux pulled as example off web after quick search):

[root@here]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:28:11:22
          inet addr:172.16.16.125  Bcast:172.16.16.100  Mask:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:237 errors:0 dropped:0 overruns:0 frame:0
          TX packets:198 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:25429 (24.8 KiB)  TX bytes:26910 (26.2 KiB)
          Interrupt:18 Base address:0x2000

eth0:0    Link encap:Ethernet  HWaddr 00:0C:29:28:11:22
          inet addr:172.16.16.126  Bcast:172.16.16.100  Mask:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:18 Base address:0x2000

eth0:1    Link encap:Ethernet  HWaddr 00:0C:29:28:11:22
          inet addr:172.16.16.127  Bcast:172.16.16.100  Mask:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:18 Base address:0x2000

Here is an example of multiple IP address on an interface (BSD based load balancer IIRC):

vlan100: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet 192.168.1.30 netmask 0xffffffff broadcast 48.0.5.12
    inet 192.168.1.40 netmask 0xffffffff broadcast 48.0.5.12
    inet 192.168.1.50 netmask 0xffffffff broadcast 48.0.5.12
    inet 1.2.3.35 netmask 0xffffffff broadcast 48.0.5.12
    inet 1.2.3.36 netmask 0xffffffff broadcast 48.0.5.12
    inet 1.2.3.37 netmask 0xffffffff broadcast 48.0.5.12
    inet 1.2.3.55 netmask 0xffffffff broadcast 48.0.5.12
    inet 1.2.3.233 netmask 0xffffffff broadcast 48.0.5.12
    inet 1.2.3.250 netmask 0xffffffff broadcast 48.0.5.12
    inet 1.2.3.252 netmask 0xffffffff broadcast 48.0.5.12
    inet 1.2.3.253 netmask 0xffffffff broadcast 60.0.5.12
    inet 192.168.1.10 netmask 0xffffff00 broadcast 192.168.1.255
    ether 00:11:22:33:44:55

How many IP addresses can a device or an interface possess?

This will be entirely dependent on what limitations are present in the device/operating system. Without knowing a specific device/operating system (and version), this is not a question that can be answered.

| improve this answer | |
2

As long as an IP address is isolated from a network containing the same IP address, there is no problem, and no conflict. One of the benefits of the Private IP Address ranges is that they can be assigned many times. They are used by just about every home and company on the Internet. They cannot be routed on the Internet for the reason that they are the same addresses used in many places. This does pose problems when two companies using the same private IP address ranges merge. NAT can be used as a temporary solution while one side or another is re-addressed. (I have been through this many times, and it is never fun.)

Another use for using the same address in multiple places is the concept of anycast. In anycast, multiple hosts have the same IP address, and the routing protocol will route traffic to the nearest one. For instance, servers like DNS, NTP, etc. could be set up in a company with a wide geographic area and many sites. These servers could be dispersed around the country in central locations, and all have the same IP address per function. When a host needs the services of one of the servers, the routing protocol will make sure it reaches the closest server. That way, only one IP address for each function needs to be configured across the entire company. When the route to the nearest server goes down, the routing protocol will send the traffic to the next nearest server with the same IP address.

One interface can certainly have multiple IP addresses, and this is mandatory with IPv6, but is a bit more difficult in IPv4, although software has become more accepting of this for IPv4.

| improve this answer | |
1

Depends on the device really. Most end user devices' NICs can handle at least one IPv4 and IPv6 (and have been able to for years).

Routers (and other network "infrastructure" devices can be assigned a lot more, mainly with the idea of subinterfaces. Basically, these are virtual interfaces that use the physical interface as a transmission medium.

I will say that your question is a little ambiguous without a reference or more detail. But I hope I gave you some sort of answer before it gets flagged.

| improve this answer | |
  • Which part is ambiguous? – user15062 Oct 26 '15 at 23:45
  • Well I mean, you say device, but it's really up to the type of device that would provide the answer. – Clarity Oct 26 '15 at 23:46
  • What? No, we're not 'devising' anything. Device is the right word. I think you're misunderstanding, what I'm saying is, depending on what device you're referring to (server, pc, router), the answer to your question will vary greatly. – Clarity Oct 26 '15 at 23:49
  • I am asking the question for any type of device. A general question. Need a general answer – user15062 Oct 26 '15 at 23:55
0

As has already been noted, it's practically universal for hosts to have more than one IP address:

  • In general practice, routers will have an IP address per interface, and possibly some secondary IP addresses for various reasons
  • Every end-point host computer will have an IP address, typically one per interface, and almost every host will have a loopback interface.

However, in a spirit of empiricism:

If there any limits for a given system depends entirely on that system.

Just for an experiment to see if there were small limits, I tried putting very many secondary addresses and found that even with what I'd consider a ridiculous number of addresses, nothing broke immediately.

A Cisco router behaved perfectly well with a 1,000 secondary addresses like this:

interface Loopback0
 ip address 10.0.1.1 255.255.0.0 secondary
 ip address 10.0.1.2 255.255.0.0 secondary
 ...
 ip address 10.0.10.100 255.255.0.0 secondary
 ip address 10.0.0.1 255.255.0.0

A very small Linux server (32-bit, kernel 3.5) still behaved reasonably well with 10,000 secondary addresses like this:

ifconfig lo:101 10.0.1.1 netmask 255.255.0.0
ifconfig lo:102 10.0.1.2 netmask 255.255.0.0
...
ifconfig lo:10100 10.0.100.100 netmask 255.255.0.0

Running ifconfig to list the interfaces does take over 30 seconds, however nothing was obviously going wrong.

| improve this answer | |
-1

each device on internet have 2 ip address as public ip and private ip. public ip is the routers ip. anyone from outside the network cannot connect to a computer with its private ip. hope im not wrong, correct me if so.

Your router assigns local IP addresses to your connected devices. This allows them to communicate amongst each other behind your router in your home. However, these local IP addresses aren’t reachable from the Internet. In other words, your public IP address might be something like 23.24.35.63. Anyone on the Internet can try to connect to this address, and they’d reach your router. Your computer’s private IP address might be something like 192.168.1.100. When someone on the Internet tries to connect to this address, their computer will look for the address 192.168.1.100 on their local network.

| improve this answer | |
  • 1
    Hello Rahitha, and welcome to Network Engineering. The way you state your response implies too a narrow view: There are plenty of devices (not all devices are routers) on the internet that have more than two addresses (some public, some private), more than two addresses (none of which private), or even only exactly one and only one public address. Not routers assign addresses (the way you imply), but functions/protocols like DHCP and PPPoE (with RADIUS and its backends) do - only in a subset of cases these features are provided by the same device that also acts as a router. – Marc 'netztier' Luethi Dec 18 '18 at 16:01

Your Answer

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