# Virtual IP to Use with ldirectord

## rollexus

Hello Everyone,

We are setting up a linux cluster using ldirector and heartbeat. We are almost up and running with only one exception, the virtual ip. We do this in debian by adding the ollowing to /etc/network/interfaces:

auto lo:0

iface lo:0 inet static

  address 10.0.1.10

  netmask 255.255.255.255

  pre-up sysctl -p > /dev/null

lo:0 will be set on however many servers which use the virtual ip. The routing is handled by ldirectord which has information regarding the VIP and the real servers. I guess what I am asking is what is the correct way of setting multiple ip addresses on loopback?

Thanks in Advance,

Nick.

----------

## rollexus

I added the following to /etc/conf.d/net:

config_lo="192.168.2.100 netmask 255.255.255.0 brd 192.168.2.255"

pinging is fine from localhost, but not from elsewhere in the network.

----------

## rollexus

Please, your help would be greatly appreciated bump.

Nick.

----------

## cach0rr0

have you defined any kind of route, default or otherwise?

----------

## rollexus

I am not behind the machine right now, I will try it again. However, I think I encountered short-circuiting when trying that. But before that,

is it possible to alias loopback and have it routed?

 *cach0rr0 wrote:*   

> have you defined any kind of route, default or otherwise?

 

----------

## cach0rr0

 *rollexus wrote:*   

> 
> 
> is it possible to alias loopback and have it routed?
> 
> 

 

I wasn't going to say anything, because I assumed you knew something I didn't (I also had my own failed effort at getting things working with ldirectord/heartbeat a while back, scrapped it, but thought I'd make an effort nonetheless!)...

but yeah, that looked a bit non-functional to me, trying to actually route traffic via lo instead of e.g. eth0

----------

## ianw1974

Another way is to add the stuff to /etc/rc.local:

```
ifconfig lo:0 x.x.x.x/xx up
```

replacing the x.x.x.x/xx with the ip and subnet mask as per your normal config.  The VIP address is bound to a loopback when using direct routing mode of your cluster.  The VIP address is assigned to a proper interface on the load balancer, so eth0:0 for example if it's brought up with heartbeat or with ldirector.

----------

