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

I am developing a web app that has to produce different output based on ip. For testing and during development it would help a lot if I could have more loopback ip addresses besides Is there a way to create (and latter destroy) these?

share|improve this question
up vote 1 down vote accepted

Edit /etc/network/interfaces

add the following at the bottom of the file

auto lo:1
iface lo:1 inet static

Documentation on interfaces file can be found here :

The definition above firstly tells the system to automatically bring the new lo:1 virtual interface up when the system starts. Then sets interface lo:1 (A virtual interface bound to the loopback interface) to be a static address. The last two lines set the address and the netmask.

After you have added the above you will need to restart networking

sudo /etc/init.d/networking restart

or reboot the computer.

share|improve this answer

The whole address space is reserved for loopback addresses. So you can use any address from up to

share|improve this answer
+1, good to know fact. However, I tried with my browser and I get (111) Connection refused error. So, I guess I should try the method @Sam suggests. – Majid Fouladpour Mar 3 '14 at 10:34

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.