I know it is possible to assign multiple IP addresses to the same NIC as long as they are on the same sub-net (e.g. server A can be assigned both 192.168.1.1 and 192.168.1.2).
However, is it possible to assign multiple IP addresses that are a different sub-net to the same NIC? The server will be connected to a switch with multiple VLANs configured on it, e.g. 192.168.1.1/24 and 10.0.0.0/24. I want the server to be both 192.168.1.1 and 10.0.0.1.
The reason I want to do this is that we currently have an internal network on 192.168.1.0/24 and we want to add additional private network for management needs: e.g. putting Dell DRAC devices on this network. I want to know if it is possible to do this without adding more cables and more switch ports.
Sure, you simply have to enable vlan tagging on the switch and the network adapter and setup both sides with all the vlans you want the computer to see.
The details about how to configure vlan trunking vary depending on what OS, and what you have to do for a specific nic or switch.
Keep in mind that this may be a bit of a security issue. Suppose this is connected to two networks which have some firewalling between them. The computer that spans these two networks becomes an alternate pathway. If an attacker can compromise the system, then they can use the system jumping point to get to the inside hosts.
I am not sure if you are doing this, but don't confuse subnets with VLANs. They are different OSI Layers, Network (IP) and Data Link (Ethernet) respectively. If you are at all unclear about this, I recommend reading the answers to this question and this question.
Having two different subnets on the same NIC doesn't have to correlate with having two VLANs on the same NIC. Adding a second subnet to a NIC in Linux is fine, you just do something like:
This will add a secondary IP to eth0.
For the VLANs with Linux, Linux Journal has nice a article on it.
Yes, you can put different subnets on the same nic, without even going into the VLAN territory. VLANs are a whole different beast and if all you need is to address different subnets, there is no reason to complicate things. Ethernet (Layer 1+2) is perfectly capable of handling multiple IP subnets (Layer 3) running on it. Magic of OSI.
Sure you can, if you're using a linux distro, you can use the vlan package ( apt-get install vlan ) under debian/ubuntu .
Yes, you can put different subnets on the same nic in Windows also. I had to do it as a temporary workaround in some hardware failure cases.