Load Balancing with CARP

Christopher Cowart ccowart at rescomp.berkeley.edu
Thu Mar 6 14:19:54 PST 2008


Hello,

I followed the instructions in carp(4) and set up a load balancing and
failover configuration on vlan interfaces -- it's working fine (as long
as I don't `ifconfig carp25 destroy'...).

In order to really make use of this functionality, I need a user land
method of figuring out whether a MAC address is coming to the local host
as the primary or secondary.

In other words, let's say I have two clients:
IP      MAC
.10     :0a
.11     :0b

And two VHIDs for the virtual router interface (IP .1):
VHID    MAC
1       :01
2       :02

Router 1 has VHID 1 primary, VHID 2 backup. Router 2 has VHID 2 primary,
VHID 1 backup. 

How can I find out which VHID the sending MAC address hashes to? 
For example:
| which_vhid :0a
| 1
| which_vhid :0b
| 2

After poking around, the only thing I can figure is reproduce the hash
function from the source code myself. I really don't want to do that if
there's another way.

Thanks,

-- 
Chris Cowart
Network Technical Lead
Network & Infrastructure Services, RSSP-IT
UC Berkeley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 825 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20080306/bd359c8a/attachment.pgp


More information about the freebsd-net mailing list