Serveur primaire

node1# more /etc/rc.conf
gateway_enable="YES"

network_interfaces="lo0 igb0 igb1 em0"
ifconfig_igb0="up"
ifconfig_igb1="inet 172.16.2.251 netmask 255.255.255.0"
ifconfig_em0="192.168.254.251 netmask 255.255.255.0"
defaultrouter="172.16.2.254"

cloned_interfaces="vlan1 vlan101 vlan102 carp0 carp1 carp2 carp3"
ifconfig_vlan1="inet 192.168.0.251 netmask 255.255.255.0 vlan 1 vlandev igb0"
ifconfig_vlan101="inet 192.168.1.251 netmask 255.255.255.0 vlan 101 vlandev igb0"
ifconfig_vlan102="inet 192.168.2.251 netmask 255.255.255.0 vlan 102 vlandev igb0"
ifconfig_carp0="vhid 1 pass my$ecret 192.168.0.254 netmask 255.255.255.0 advbase 1 advskew 0"
ifconfig_carp1="vhid 2 pass my$ecret 192.168.1.254 netmask 255.255.255.0 advbase 1 advskew 0"
ifconfig_carp2="vhid 3 pass my$ecret 192.168.2.254 netmask 255.255.255.0 advbase 1 advskew 0"
ifconfig_carp3="vhid 4 pass my$ecret 172.16.2.253 netmask 255.255.255.0 advbase 1 advskew 0"

pf_enable="YES"
pf_flags=""
pf_rules="/etc/fw.conf"
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
pfsync_enable="YES"
pfsync_syncdev="em0"
pfsync_syncpeer="192.168.254.252"
node1# echo net.inet.carp.preempt=1 > /etc/sysctl.conf
node1# sysctl net.inet.carp.preempt=1
node1# ee pf.conf
pass quick on em0 inet proto pfsync from any to any
pass quick on { vlan1 vlan101 vlan102 igb1 } inet proto carp from any to any

Serveur secondaire

node2# more /etc/rc.conf
gateway_enable="YES"

network_interfaces="lo0 igb0 igb1 em0"
ifconfig_igb0="up"
ifconfig_igb1="inet 172.16.2.252 netmask 255.255.255.0"
ifconfig_em0="192.168.254.252 netmask 255.255.255.0"
defaultrouter="172.16.2.254"

cloned_interfaces="vlan1 vlan101 vlan102 carp0 carp1 carp2 carp3"
ifconfig_vlan1="inet 192.168.0.252 netmask 255.255.255.0 vlan 1 vlandev igb0"
ifconfig_vlan101="inet 192.168.1.252 netmask 255.255.255.0 vlan 101 vlandev igb0"
ifconfig_vlan102="inet 192.168.2.252 netmask 255.255.255.0 vlan 102 vlandev igb0"
ifconfig_carp0="vhid 1 pass my$ecret 192.168.0.254 netmask 255.255.255.0 advbase 1 advskew 100"
ifconfig_carp1="vhid 2 pass my$ecret 192.168.1.254 netmask 255.255.255.0 advbase 1 advskew 100"
ifconfig_carp2="vhid 3 pass my$ecret 192.168.2.254 netmask 255.255.255.0 advbase 1 advskew 100"
ifconfig_carp3="vhid 4 pass my$ecret 172.16.2.253 netmask 255.255.255.0 advbase 1 advskew 100"

pf_enable="YES"
pf_flags=""
pf_rules="/etc/fw.conf"
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
pfsync_enable="YES"
pfsync_syncdev="em0"
pfsync_syncpeer="192.168.254.251"
node2# echo net.inet.carp.preempt=1 > /etc/sysctl.conf
node2# sysctl net.inet.carp.preempt=1
node2# ee pf.conf
pass quick on em0 inet proto pfsync from any to any
pass quick on { vlan1 vlan101 vlan102 igb1 } inet proto carp from any to any