Sauter la navigation.
Accueil
unix forever

ucarp with Solaris

Unfortunately, there was no easy solution to share a virtual IP address beetween some Solaris OS. Indeed, while there is Sun Cluster, it's a bit overkill if your only requirement is a virtual IP.

Though, for few weeks now, an UCARP package is available in blastwave testing repository. I test it for a customer, on Solaris 8 sparc, and I was very happy with it. In few minutes, I installed the packages, and create some scripts to add / remove the virtual address.

/etc/ucarp/config.sh

LOGICAL_IF=bge0:1
LOGICAL_ADDRESS=192.168.0.253
LOGICAL_NETMASK=255.255.255.0
GATEWAY_ADDRESS=192.168.0.254

/etc/ucarp/vip_up.sh

#!/bin/sh
# Read config
. /etc/ucarp/config.sh
# Create the new interface and add the logical address
ifconfig $LOGICAL_IF plumb
ifconfig $LOGICAL_IF $LOGICAL_ADDRESS netmask $LOGICAL_NETMASK
ifconfig $LOGICAL_IF up
# Send ARP packet to gateway (send 3 ICMP packets with 10 bytes, 2sec beetween interval)
# The ping is made on background because ucarp wait for the end of the script
ping -i $LOGICAL_ADDRESS -I 2 $GATEWAY_ADDRESS 10 3 &

/etc/ucarp/vip_down.sh

#!/bin/sh
# Read config
. /etc/ucarp/config.sh
ifconfig removeif $LOGICAL_ADDRESS
ifconfig $LOGICAL_IF unplumb