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'm doing some computer network homework and I'm supposed to develop some sort of Peer to Peer file sharing software, and when I wanna test it I need to run a few (5) instances on my linux/ubuntnu 11.10 . which means each one need to has a unique IP address. I heard I can do that but I dunno how. how can I have many IP addresses on a single computer? thanks

share|improve this question

closed as off topic by splattne Feb 2 '12 at 11:47

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 5 down vote accepted

It is not really clear what you are trying to do, but you can run multiple virtual machines (virtualization) on your PC to do your tests using a single machine.

If you want to have multiple IP addresses on the same physical interface, that is another thing. If this is what you want, you can do it the old way using ifconfig or the new way using ip addr add.

The old way:

$ sudo ifconfig eth0:0 your.ip.addr.ess netmask up

The new way:

$ sudo ip addr add your.ip.addr.ess/mask.bits dev eth0

Of course, you need to replace your.ip.addr.ess with real value like and with something like The mask.bits can be something like 24. You may need also to change the device name eth0. To view the IPs currently added, you can use ifconfig (old) or ip addr show (new).

share|improve this answer
yes I want multiple IP addresses on the same physical interface – ePezhman Feb 2 '12 at 9:31

You need to create a subinterface inorder to assign a multiple ip to the same interface (for e.g. eth0). The command for assigning suppose 2 Ip address like & to interface eth0 will be as follows

# ifconfig eth0 netmask up

# ifconfig eth0:1 netmask up

After this restart the network

service network restart

I hope this answers your question...

share|improve this answer

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