Permanently add second loopback (127.0.0.2) to opensuse

Hi,
I need to have a second loopback interface in my OpenSUSE 12.1 server , 127.0.0.2
I can create it with a simple ifconfig command:

ifconfig lo:1 127.0.0.2

But, what is the recommended way to make it permanent? (After a reboot) Can’t find a way to to that with Yast.

Thanks,
Ignacio

Perhaps create an init script for it? Drop the command in
/etc/init.d/after.local and it should run there.

Out of curiosity, why do you feel like you need this?

Good luck.

Are you sure you really need another <interface> or just a new working address?
Although maybe possible, I have yet to run into a situation that required a new interface, and it likely hardly makes much sense unless you really need to isolate your two loopback addresses.

If you don’t need another interface but need the additional address, AFAIK you only need to add to your Hosts file, by default the loopback interface should support the entire 127.0.0.0/8 address space by default.

TSU

Actually lo interface will answer to request on any address from 127.0.0.0/8 network. Just try to connect to 127.0.0.2, 127.0.0.3 etc. So I guess it would help if you explained what you intend to do.

Thanks for your reply. I need to run multiple instances of JBoss and I bind each one to a different loopback interface so they are not accessible from outside without having to tweak firewall settings.

I didn’t know that (!!!). I’ll try to run my different JBoss’s binding to 127.0.0.2 without ifconfig’ing it to see if it just works. Thanks.