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

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?

100k 26 26 gold badges 121 121 silver badges 198 198 bronze badges asked Oct 26, 2015 at 23:29 user15062 user15062

5 Answers 5

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 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.