Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I have created 3 virtual interface on a Linux system, using different IP address.

I have a software doing requests to a server but it use the default interface, eth0.

Is it possible to execute a software using another IP address/interface temporarily, like eth0:1?

Something like :

USE_INTERFACE=eth0:1 node test.js
share|improve this question

This is usually up to the software to support. It is usually implemented by binding the socket to the IP address of the interface you want to use. Check the documentation for a way to bind to a local ip address.

If the software does not support that you have access to the source, you may add or alter the bind() call after creating the socket, so bind to the interface you want.

It may also be possible to hide unwanted interfaces with the control groups features, if your kernel supports it.

share|improve this answer

You can override without touching to the software thanks to LD_PRELOAD.

I found that :


Compile it then :

$ BIND_ADDR="virtual_interface_ip" LD_PRELOAD=./ ssh

And it will use the virtual interface ip !

Then if you need to have multiple mac adresses on the same network card, you can use multimac :


Happy hacking !

share|improve this answer

Ok it's easier by using the same strategy than virtualization system. Using bridge mode, brctl, here is a tutorial :

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.