How to get FreeBSD’s CARP working on CloudSigma

March 23, 2011 4:34 am    Posted by Viktor Petersson    Comments (11)

For a few months now, we’ve been working on migrating our physical architecture for YippieMove over to CloudSigma. We got everything up and running swiftly, with the exception of one thing: CARP.

As it turns out FreeBSD’s CARP implementation doesn’t really work very well in a virtual environment. (For those curious about the details, please see this mailing list post.)

In order to get up and running with CARP on CloudSigma, you need to do the following:

  • Download the FreeBSD kernel source
  • Download this patch (mirror)
  • Apply the patch (cd /usr/src/sys/netinet && patch -p0 < /path/to/esx-carp.diff)
  • Recompile and install your kernel (make sure to include “device carp” in your kernel config)
  • Add “net.inet.carp.drop_echoed=1″ to /etc/sysctl.conf
  • Reboot into the new kernel

That’s it. You should now be able to set up CARP as usual. For more information on how to configure CARP, please see my article Setting up a redundant NAS with HAST and CARP. That article also includes detailed instructions on how to download FreeBSD’s kernel source and how to compile your kernel.

As a technical side note, I got this working with FreeBSD 8.2 and the kernel source from the RELENG_8 branch.

Credits: Matthew Grooms for the patch and Daniel Hartmeier for great analysis.

11 Responses to “How to get FreeBSD’s CARP working on CloudSigma”

  1. jorgeespada says:

    Cool, very useful, thanks for share..

  2. Nice work, well done.

  3. Pfarthing6 says:

    Thanks a lot! Didn’t know about that sysctl directive.

    I was actually able to get it going with just the “net.inet.carp.drop_echoed=1″ on vmware with permiscuous mode enabled on 8.2-REALEASE. Didn’t have to patch. So maybe the patch has already been added?

    • Anonymous says:

      Interesting observation. I actually never tried setting that sysctl value w/out applying the patch, so you might be right.

      That said, the patch did apply w/out any errors, so it must have done something.

  4. Patrick says:

    Did you experiment any issue when trying to install Freebsd 8.2 to CloudSigma?
    After using the fix for amd on kvm, I could create any partition. I could only manage to create a / master partition. It took me five hours to get it work eventually. I just needed to change the order of the partitions
    /
    /home
    /tmp
    /usr
    /var

    Does it make any sense?

    • Anonymous says:

      That’s odd. No, I didn’t encounter any issue at all with that. Then again, I just used the auto-partitioning, so never really manually played around with it.

      • Patrick says:

        auto-partitioning meaning auto default from sysinstall. I did try and did not succeed. Funny
        Sorry to bother you with this.

        Regarding CARP, I am really interested to give a go as we are using it for in our actual network.

        A quick question, do you use a router? We are going to setup a proxy/router and I am trying to see how I can create the same redundancy architecture.

        Thanks

        • Anonymous says:

          > auto-partitioning meaning auto default from sysinstall.
          Yes, during the install. I did have some issues with
          partitioning with disks in sysinstall once installed, but
          never really got around to find the problem. A few retries did the trick.

          > A quick question, do you use a router? We are going to setup a
          > proxy/router and I am trying to see how I can create the same
          > redundancy architecture.

          No, we just used it to create redundancy within the network,
          not create redundancy w/out CloudSigma’s network. That’s a good thought
          but I haven’t gotten to that.

          • Patrick says:

            Did have the same and needed to retry more than once

            For redundancy, I kind trust their architecture better than mine :-)
            I will need to see how I could back up our main router and create some kind of script from an external server to check availability, if the check failed I could use their API to recreate the server from a backup/template. Only thing I will like to see implemented is a schedule backup from their service. I am using the same with the Rackspace and it is really nice, only problem with Rackspace is Freebsd, no support

  5. [...] work (while this works perfectly fine with OpenBSD’s CARP, and Linux’s VRRD). I have written about workarounds for this issue in the past, but they do not seem to work equally well in FreeBSD [...]


Leave a Reply