Can a single network card have 2 IP addresses?

Are network cards and IP addresses a one-one map?


On linux, the command is ip addr add IFADDR dev STRING, where IFADDR and STRING are replaced by the IP address and device name. You can see some examples in the Guide to IP Layer NEtwork Administration with Linux. You'll also want to specify your routes that use that IP address using ip route. Again, the guide comes through.

Even though the syntax of the ip commands makes it seem that you are associating the IP address with a specific network card, linux considers the IP address as belonging to the overall system. Thus in some circumstances you may want to twiddle with ARP settings.


Yes, you can have multiple; they are not one to one.

A single network card can do this in a couple of ways; it can answer for multiple IP addresses with a single MAC address (assigning multiple addresses to a NIC in most operating systems will do this), or with multiple MAC addresses (virtualization platforms behave in this way).


A single physical network card definitely can have multiple IP addresses. This is almost essential when implementing server virtualization: with multiple virtual servers running on the same physical hardware, each needs its own IP address.


Not only is this possible, it is very common. A network card may have multiple IP addresses. This is a concept called multihoming. There are other variants of multihoming as well.