CARP within VirtualBox Does it work?

Fleuriot Damien ml at my.gd
Thu Nov 29 18:53:12 UTC 2012


On Nov 29, 2012, at 6:43 PM, dweimer <dweimer at dweimer.net> wrote:

> I was trying to setup a test of CARP on two virtual machines running in VirtualBox 4.2.4r81684 I am not sure if I have something wrong with my CARP configuration or if VirtualBox just doesn't work right with it.  I can only ping the CARP interface IP address from the machine listed as MASTER, if I do an ifconfig carp0 down on the MASTER the other machine correctly switches form BACKUP to MASTER and then I can ping the interface from it but not from the Original system.
> 
> The VirtualBox systems are both using bridged networking, and the host cannot ping the carp0 IP address but can ping the interface IP address.
> 
> Before I go through more trouble shooting, does anyone know if CARP doesn't work with VirtualBox?
> 
> carp configuration
> Machine1:
> ifconfig_em0="UP"
> ifconfig_em0_name="LAN"
> ipv4_addrs_LAN="10.20.190.201/16"
> defaultrouter="10.20.111.2"
> cloned_interfaces="carp0"
> ifconfig_carp0="vhid 1 advskew 100 pass ReduntantCarpTest 10.20.190.203/16
> 
> ifconfig carp0:
> carp0 flags=49<UP,LOOPBACK,RUNNING> metric 0 mtu 1500
> inet 10.20.190.203 netmask 0xffff0000
> nd6 options=29<PREFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
> carp: MASTER vhid 1 advbase 1 advskew 100
> 
> 
> Machine2:
> ifconfig_em0="UP"
> ifconfig_em0_name="LAN"
> ipv4_addrs_LAN="10.20.190.202/16"
> defaultrouter="10.20.111.2"
> cloned_interfaces="carp0"
> ifconfig_carp0="vhid 1 pass ReduntantCarpTest 10.20.190.203/16
> 
> ifconfig carp0:
> carp0 flags=49<UP,LOOPBACK,RUNNING> metric 0 mtu 1500
> inet 10.20.190.203 netmask 0xffff0000
> nd6 options=29<PREFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
> carp: BACKUP vhid 1 advbase 1 advskew 0
> 
> FreeBSD version is 9.1RC3 on both test machines.



We're using FreeBSD and CARP in virtualized environments at work, albeit not on VirtualBox but on Proxmox/KVM.

First, I would advise replacing 10.20.190.203/16 with 10.20.190.203/32


I notice your carp0 is MASTER on machine1 with an advskew of 100 vs machine 2 advskew 0, same advbase.
Confirm this is *after* you've set carp0 down on machine2.

If both carps are up and machine1 with advskew 100 beats machine2 with advskew 0, you have an additional problem.


See if you have any more luck with the /32 address on carp0 anyway.



More information about the freebsd-questions mailing list