From owner-svn-src-all@FreeBSD.ORG Mon Aug 15 12:08:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AF201065675; Mon, 15 Aug 2011 12:08:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 624938FC1E; Mon, 15 Aug 2011 12:08:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7FC8fWG009428; Mon, 15 Aug 2011 12:08:41 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7FC8frR009426; Mon, 15 Aug 2011 12:08:41 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201108151208.p7FC8frR009426@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 15 Aug 2011 12:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224879 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2011 12:08:41 -0000 Author: glebius Date: Mon Aug 15 12:08:41 2011 New Revision: 224879 URL: http://svn.freebsd.org/changeset/base/224879 Log: Describe how carp(4) status changes can be processed with help of devd(8). Submitted by: "Alexander V. Chernikov" Approved by: re (kib) Modified: head/share/man/man4/carp.4 Modified: head/share/man/man4/carp.4 ============================================================================== --- head/share/man/man4/carp.4 Mon Aug 15 09:26:53 2011 (r224878) +++ head/share/man/man4/carp.4 Mon Aug 15 12:08:41 2011 (r224879) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2010 +.Dd August 15, 2011 .Dt CARP 4 .Os .Sh NAME @@ -168,6 +168,25 @@ forwarded to its destination, and destin than the state information is packed and synced with the second router. If the reply would be load balanced to second router, it will be dropped due to no state. +.Sh STATE CHANGE NOTIFICATIONS +Sometimes it is useful to get notified about +.Nm +status change events. +This can be accomplished by using +.Xr devd 8 +hooks. +Master/slave events are signalled as +.Nm +interface +.Dv LINK_UP +or +.Dv LINK_DOWN +event. +Please see +.Xr devd.conf 5 +and +.Sx EXAMPLES +section for more information. .Sh EXAMPLES For firewalls and routers with multiple interfaces, it is desirable to failover all of the @@ -249,6 +268,25 @@ This way, locally connected systems will subsequent IP traffic will be balanced among the hosts. If one of the hosts fails, the other will take over the virtual MAC address, and begin answering ARP requests on its behalf. +.Pp +Processing of +.Nm +status change events can be set up by using the following devd.conf rules: +.Bd -literal -offset indent +notify 0 { + match "system" "IFNET"; + match "type" "LINK_UP"; + match "subsystem" "carp*"; + action "/root/carpcontrol.sh $type $subsystem"; +}; + +notify 0 { + match "system" "IFNET"; + match "type" "LINK_UP"; + match "subsystem" "carp*"; + action "/root/carpcontrol.sh $type $subsystem"; +}; +.Ed .Sh SEE ALSO .Xr inet 4 , .Xr pfsync 4 ,