Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to configure in the same NIC a VIP and a private IP (different) and both be enabled/accesible?
If yes, is there a guarantee that the communication path for these 2 IPs will be exactly the same?
Update: If this is possible, if I e.g. do a ping (or traceroute) from a specific machine will I always have the same route for both these 2 IPs?

share|improve this question
what do you mean by vip? An IP is an IP. you can assign as many as you like. The path selected depends on the routing table. – Zoredache Dec 12 '12 at 21:40
Virtual IP I mean.So I can have both a public virtual IP and a public IP?Also the routing table could be different even if the MAC destined is the same? – user76678 Dec 12 '12 at 21:43
You're question isn't very clear and I'm not sure how you imagine it is that you'd assign a "VIP" to the NIC, but certain load balancing technologies (such as NLB in Windows) create a virtual ip address and bind it to the NIC of the load balanced members. Is this what you're referring to? – joeqwerty Dec 12 '12 at 21:47
@joeqwerty:Correct – user76678 Dec 12 '12 at 21:48
@joeqwerty:Updated OP – user76678 Dec 12 '12 at 22:08

You can have as many virtual IPs on the same physical device. On Linux you can create virtual interfaces for an IP (mostly) like this:

ifconfig eth0:0 netmask up

or via /etc/network/interfaces

The route for every IP can be determined independently. Every IP can have a different default route. But you can ping in and out from every of this IPs

share|improve this answer

Having multiple IPs on a NIC is not an issue at all. You can use regular tools like ip addr add dev eth0 and a configuration file would be distribution dependent.

The switch where your nic is connected will broadcast a "who has IP a.b.c.d" and your NIC will respond if it is one of the IPs it has. Receiving packets is not an issue.

The outgoing packets, however, are a different story. In response to a ping, the outgoing packet's source IP will be determined from the routing table (ip route show). This will be most likely based on the destination IP, and depending on which IP got pinged, you could have problems.

share|improve this answer

Your Answer


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.