Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
You should specify your OS –  Kyle Brandt Sep 3 '09 at 18:17
    
We have a mixed set of CentOS 5 and Windows 2003 servers. –  sagi Sep 3 '09 at 18:38

5 Answers 5

up vote 9 down vote accepted

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.

share|improve this answer

Sure you can, if you're using a linux distro, you can use the vlan package ( apt-get install vlan ) under debian/ubuntu .

share|improve this answer

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 to VLANs on the same NIC. Adding a second subnet to NIC in Linux is fine, you just do something like:

ifconfig eth0:1 192.168.7.1 netmask 255.255.255.0

This will add a secondary IP to eth0.

For the VLANs with Linux, Linux Journal has nice a article on it.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer
    
That's really not the same thing as vLANs. –  Chris S Oct 4 '11 at 13:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.