--- src/share/man/man4/pfsync.4 2006/05/26 19:39:39 1.4 +++ src/share/man/man4/pfsync.4 2007/08/16 20:03:56 1.5 @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 29, 2002 +.Dd April 9, 2007 .Dt PFSYNC 4 .Os .Sh NAME @@ -129,8 +129,76 @@ only the necessary information. # ifconfig pfsync0 up syncif fxp0 maxupd 64 # tcpdump -s1500 -evtni pfsync0 .Ed +.Sh USING PFSYNC WITH CARP +.Nm +and +.Xr carp 4 +can be used together to provide automatic failover of a pair of firewalls +configured in parallel. +One firewall handles all traffic \- if it dies or +is shut down, the second firewall takes over automatically. +.Pp +Both firewalls in this example have three +.Xr sis 4 +interfaces. +sis0 is the external interface, on the 10.0.0.0/24 subnet; sis1 is the +internal interface, on the 192.168.0.0/24 subnet; and sis2 is the +.Nm +interface, using the 192.168.254.0/24 subnet. +A crossover cable connects the two firewalls via their sis2 interfaces. +On all three interfaces, firewall A uses the .254 address, while firewall B +uses .253. +The interfaces are configured as follows (firewall A unless otherwise +indicated): +.Pp +Interfaces configuration in +.Pa /etc/rc.conf : +.Bd -literal -offset indent +network_interfaces="lo0 sis0 sis1 sis2" +cloned_interfaces="carp0 carp1" +ifconfig_sis0="10.0.0.254/24" +ifconfig_sis1="192.168.0.254/24" +ifconfig_sis2="192.168.254.254/24" +ifconfig_carp0="vhid 1 pass foo 10.0.0.1/24" +ifconfig_carp1="vhid 2 pass bar 192.168.0.1/24" +pfsync_enable="YES" +pfsync_syncdev="sis2" +.Ed +.Pp +.Xr pf 4 +must also be configured to allow +.Nm +and +.Xr carp 4 +traffic through. +The following should be added to the top of +.Pa /etc/pf.conf : +.Bd -literal -offset indent +pass quick on { sis2 } proto pfsync +pass quick on { sis0 sis1 } proto carp keep state +.Ed +.Pp +If it is preferable that one firewall handle the traffic, +the +.Ar advskew +on the backup firewall's +.Xr carp 4 +interfaces should be set to something higher than +the primary's. +For example, if firewall B is the backup, its +carp1 configuration would look like this: +.Bd -literal -offset indent +ifconfig_carp1="vhid 2 pass bar advskew 100 192.168.0.1/24" +.Ed +.Pp +The following must also be added to +.Pa /etc/sysctl.conf : +.Bd -literal -offset indent +net.inet.carp.preempt=1 +.Ed .Sh SEE ALSO .Xr tcpdump 1 , +.Xr carp 4 , .Xr bpf 4 , .Xr inet 4 , .Xr inet6 4 ,