Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Thread Tools Display Modes
  #1   (View Single Post)  
Old 15th April 2009
ohhcarp ohhcarp is offline
New User
Join Date: Apr 2009
Posts: 1
Default carp configuration


im trying to experement with carp for the first time and not finding many resources on it, was hoping somebody on here might be able to tell me what to do.

firstly what i want to do is very basic, i will describe my set up.

| |
| |
| |
| |

ROU= router

the routers are both identical computers (two network cards in each) running openBSD.
all that i am wanting to do is send packets (ping) from one client to the other. pull the cable from my default router. so that fail overtakes place and i keep on receving ping comfromation.

if anybody would be able to tell me how to configure that i would be so thankfull and forever in their debt!!!!

Reply With Quote
  #2   (View Single Post)  
Old 15th April 2009
ocicat ocicat is offline
Join Date: Apr 2008
Posts: 3,306

Originally Posted by ohhcarp View Post
im trying to experement with carp for the first time and not finding many resources on it...
FWIW, textual diagrams need to be wrapped in [code] / [/code] tags to preserve spacing.

As for your question, I am only aware of four sources of information on CARP configuration:Of these four, I would suggest starting with the FAQ, followed by studying the manpage. If you are still needing more information, Hansteen's book walks through a simple fail-over configuration.
Reply With Quote
  #3   (View Single Post)  
Old 15th April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
Join Date: May 2008
Location: USA
Posts: 7,033

Here's an example. Source: carp(4) and the carp section of ifconfig(8).

Standard network admin knowledge assumed, such as setting packet forwarding on, and setting route tables in the clients (for this test).

Using your ASCII graphic. Assuming failover, no load balancing, and the left router is the default master. NAT is not used in this example.

top client: NIC set to
bottom client: NIC set to

left router: top NIC set to, bottom NIC to
right router: top NIC set to, bottom NIC to

The routers will share redundant addresses 10.x.0.2.

left router:

# sysctl net.inet.carp.preempt=1 (see carp man page)
# ifconfig carp0 vhid 1
# ifconfig carp1 vhid 2

right router:

# sysctl net.inet.carp.preempt=1
# ifconfig carp0 vhid 1 advskew 100
# ifconfig carp1 vhid 2 advskew 100

Tested with a little network of virtual machines on a windows box at work. Load balancing, NAT, PF, pfsync(4) are left to the poster to uncover and learn.

Last edited by jggimi; 15th April 2009 at 05:43 PM. Reason: found a typo (missing ".") in one of the ifconfig commands.
Reply With Quote
  #4   (View Single Post)  
Old 16th April 2009
ai-danno's Avatar
ai-danno ai-danno is offline
Spam Deminer
Join Date: May 2008
Location: Boca Raton, Florida
Posts: 284

The following link does not mirror your configuration, but shows carp in action as I use it at work for redundant caching-only DNS servers-


If anyone asks, "Why would CARP be needed for DNS resolver redundancy?" then they haven't waited while their computer times out on the first failed DNS server (the primary) before attempting the secondary server. With CARP, the primary is "always on" even when taken down for maintenance. And if users think they're clever by reversing the primary and secondary resolvers in their machine configurations... well, the secondary is CARP'd as well.
Network Firefighter
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Clustering with CARP revzalot OpenBSD General 10 17th September 2009 04:44 AM
CARP interface with DHClient xinform3n OpenBSD General 5 22nd July 2009 12:41 PM
Carp + Trunk firewall mururoa OpenBSD General 0 2nd June 2009 01:01 PM
pfsync+carp+wifi firewall redundancy inquiry revzalot OpenBSD Security 1 18th May 2009 03:06 PM

All times are GMT. The time now is 02:41 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick