Are network cards and IP addresses a one-one map?
|
|
On linux, the command is Even though the syntax of the |
|||
|
|
|
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). |
|||||||||||||||
|
|
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. |
|||
|
|
|
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. |
|||
|
|
|
Yes you can have more than one IP address when using a single Network Card. Setting this up is different in each Operating System, but may involve creating a new Network Interface. This can look like a unique connection but will be using the same Network Card behind the scenes. OS X and Linux use this method. To add a new IP address in Windows open up the network connection you wish to add another IP address to. Go to Properties –> Internet Protocol (TCP/IP) –> Advanced –> In IP settings, click add and add the new IP address and netmask. This can be used to expose a server in two network ranges. For example one network range may be used for secure traffic which the other network range cannot access. Firewall rules could be different for each Network Interface. |
|||||||
|
|
IP layer (the ip address) is completely independent from the physical layer (your network adapter). If your operating system has properly implemented the OSI stack or some close model of it you should be able to easily define several incoming IP addresses on a single network interface. Handling incoming traffic over multiple IP's is pretty easy within linux. However, it's a little more tricky making outgoing traffic have different source IPs when sharing a single interface. Applications typically default to use the primary IP for outgoing source if you don't do anything special to force another IP to show up, but it's definitely possible to do this as well. |
|||
|
|
A very common example of one NIC with multiple IP addresses is where the NIC provides a management interface in addition to what the OS sees. e.g. HP servers with ILO. |
||||
|
|