# adding ip alias to lo (loopback)

## darkphader

Unlike ethx, lo already has an ip address associated with it and doesn't appear in /etc/conf.d/net. There's also nothing concerning lo in the /etc/conf.d/net.example file.

What is the syntax to add an IP alias to lo via /etc/conf.d/net ?

Thanks.

Chris

----------

## darkphader

Bug report filed about a year ago. Still waiting for fix. 

https://bugs.gentoo.org/show_bug.cgi?id=58533

----------

## songpenguin

I reall don't know why you would want to do this. The computer automatically used loopback if you try to send something to your normal eth0 IP (like 192.168.0.100 for me uses the loopback, as does 127.0.0.1). Also, you can use any of the 127.*.*.* ip adresses (they all go to loopback).

Heres an idea though, you could set up a dummy network connection and give it the IP address that you want to be sent over loopback. I have never tried it, but I am pretty certian it would work. Warning: even if you do find out how to change the loopback IP adress, don't; a lot of programs expect a 127.0.0.1 loopback IP.

Hope this helps,

Songpenguin

----------

## darkphader

 *songpenguin wrote:*   

> I reall don't know why you would want to do this.

 It can be quite useful. See http://www-128.ibm.com/developerworks/lotus/library/edgehighavail/ for one example.

 *songpenguin wrote:*   

> Also, you can use any of the 127.*.*.* ip adresses (they all go to loopback).

 Yes, but it's not the same thing because it's the same interface. Adding an alias to eth0, for example, produces eth0:1; a different interface.

 *songpenguin wrote:*   

> Warning: even if you do find out how to change the loopback IP adress, don't; a lot of programs expect a 127.0.0.1 loopback IP.

 I'm not trying to change it, just to add an alias.

----------

## songpenguin

well, making the dummy net will probably work. It works with eth0, should work with dummy.

Hope that helps,

Songpenguin

----------

## darkphader

 *songpenguin wrote:*   

> well, making the dummy net will probably work. It works with eth0, should work with dummy.

 

It may, but then I could just as easily manually assign the lo alias.

The point is that baselayout should allow this flexibilty for lo just like it does for ethx.

----------

## songpenguin

I think the reason that the loopback interface does not allow for a manual assignment of an IP adress is that it is more of a meta-net that is used whenever a packet's source and destination are the same computer.

--

Songpenguin

----------

## UberLord

 *darkphader wrote:*   

> It may, but then I could just as easily manually assign the lo alias.
> 
> The point is that baselayout should allow this flexibilty for lo just like it does for ethx.

 

It already does - baselayout-1.12.0-alpha2-r1 currently in portage allows this.

However, that version of baselayout is a little too buggy to use.

We're aiming for a new 1.12.0pre1 next week.

----------

## darkphader

 *songpenguin wrote:*   

> I think the reason that the loopback interface does not allow for a manual assignment of an IP adress is that it is more of a meta-net that is used whenever a packet's source and destination are the same computer.

 

You can do it manually, it's just not integrated with baselayout yet (in the useable released versions) and therefore currently a limitation of the distro that is being rectified.

----------

## darkphader

 *UberLord wrote:*   

> It already does - baselayout-1.12.0-alpha2-r1 currently in portage allows this.
> 
> However, that version of baselayout is a little too buggy to use.
> 
> We're aiming for a new 1.12.0pre1 next week.

 

Thanks much. Especially for warning me away from the alpha version (I had thought about trying it but then came to my senses).

----------

