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 127.0.0.1. Is there a way to create (and latter destroy) these?
add the following at the bottom of the file
Documentation on interfaces file can be found here : http://manpages.ubuntu.com/manpages/lucid/man5/interfaces.5.html
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
or reboot the computer.