Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Mar 2011 17:13:55 +0100
From:      Giuseppe Maniscalco <peppe.maniscalco@gmail.com>
To:        freebsd-pf@freebsd.org
Subject:   FreeBSD7, pf, carp...
Message-ID:  <AANLkTindy0g6%2BwLwZMRxz8QZTjOgV4Y75Epr9-JcKevp@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi List! I need your help!!!

I've two firewalls configured in parallel (connected with a crossover
cable) and I use pfsync+carp to failover. So one firewall (A) handles
all traffic as MASTER and, if it dies or if some NIC interface go
down, the second firewall (B) takes over automatically.
Well... As usually everything works properly, but since a few days ago
"B" takes control and "A" become backup. But "A" cannot return to be
master until rebooting!
After reboot, "A" is the master for a while, then I've the same problem...

I identified a problem here:

fwA# sysctl -a | grep arp
net.inet.ip.same_prefix_carp_only: 0
net.inet.carp.allow: 1
net.inet.carp.preempt: 1
net.inet.carp.log: 1
net.inet.carp.arpbalance: 0
net.inet.carp.suppress_preempt: 1

>From man carp:
net.inet.carp.suppress_preempt:
A read only value showing the status of preemption suppression.
Preemption can be suppressed if link on an interface is down or when
pfsync(4) interface is not synchronized.
Value of 0 means that preemption is not suppressed, since no problems
are detected. Every problem increments suppression counter.

All my interfaces are UP... now I don't know how to check if pfsync is
synched or not...

Meanwhile, in B node:
fwB# sysctl -a | grep arp
net.inet.ip.same_prefix_carp_only: 0
net.inet.carp.allow: 1
net.inet.carp.preempt: 1
net.inet.carp.log: 1
net.inet.carp.arpbalance: 0
net.inet.carp.suppress_preempt: 0

I tried with a tcpdump on the interfaces, but I see just the change of
condition (master/backup) with the advskew modification...
This is the only strange thing on DMZ interface... :

17:01:32.397429 01:80:c2:00:00:01 (oui Unknown) > 01:80:c2:00:00:01
(oui Unknown), ethertype Unknown (0x8808), length 60:
0x0000: 0001 ffff 0000 0000 0000 0000 0000 0000 ................
0x0010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0020: 0000 0000 0000 0000 0000 0000 0000 ..............

I just tried to change the NIC, but nothing! "A" continue to lose
control in 30/45 minutes...

I read somewhere that the result of "pfctl -ss" must give the same
result on both nodes:

fwA# pfctl -ss | wc -l
5833
fwB# pfctl -ss | wc -l
5507

Could it be important?


Some additional information:

fwA# more /etc/rc.conf
ifconfig_em0="inet a.a.a.12 netmask 255.255.255.0 polling" ### DMZ ###
ifconfig_em1="inet b.b.b.2 netmask 255.255.0.0 polling" ### CROSSOVER ###
ifconfig_em2="inet c.c.c.189 netmask 255.255.255.224 polling" ### ISP1 ###
ifconfig_em3="inet d.d.d.249 netmask 255.255.255.0 polling" ### ISP2 ###
defaultrouter="c.c.c.1"

#Firewall
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_flags=""
pflog_enable="YES"
pflog_logfile="/var/log/pflog"

#Failover
pfsync_enable="YES"
pfsync_syncdev="em1"
cloned_interfaces="carp0 carp1 carp2"
ifconfig_carp0="a.a.a.1/24 vhid 1 pass foo"
ifconfig_carp0_alias0="a.a.a.11/24 vhid 1 pass foo"
ifconfig_carp1="d.d.d.14/24 vhid 2 pass bar"
ifconfig_carp1_alias0="d.d.d.2/24 vhid 2 pass bar"
ifconfig_carp2="c.c.c.188/27 vhid 3 pass jack"
ifconfig_carp2_alias0="c.c.c.165/27 vhid 3 pass jack"

fwB# more /etc/rc.conf
ifconfig_ste0="inet a.a.a.13 netmask 255.255.255.0 polling"
ifconfig_ste1="inet b.b.b.3 netmask 255.255.0.0 polling"
ifconfig_em0="inet c.c.c.190 netmask 255.255.255.224 polling"
ifconfig_em1="inet d.d.d.250 netmask 255.255.255.0 polling"
defaultrouter="c.c.c.1"

#Firewall
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_flags=""
pflog_enable="YES"
pflog_logfile="/var/log/pflog"

#Failover
pfsync_enable="YES"
pfsync_syncdev="ste1"
cloned_interfaces="carp0 carp1 carp2"
ifconfig_carp0="a.a.a.1/24 vhid 1 advskew 128 pass foo"
ifconfig_carp0_alias0="a.a.a.11/24 vhid 1 advskew 128 pass foo"
ifconfig_carp1="d.d.d.14/24 vhid 2 advskew 64 pass bar"
ifconfig_carp1_alias0="d.d.d.2/24 vhid 2 advskew 64 pass bar"
ifconfig_carp2="c.c.c.188/27 vhid 3 advskew 100 pass jack"
ifconfig_carp2_alias0="c.c.c.165/27 vhid 3 advskew 100 pass jack"

In each node pf.conf I added:

fwA# more pf.conf | grep failover
pass quick on { em1 } proto pfsync # failover
pass on { em0 em2 em3 } proto carp # failover

fwB# more pf.conf | grep failover
pass quick on { ste1 } proto pfsync # failover
pass on { em0 ste0 em1 } proto carp # failover


I hope that someone can give me a solution please, or maybe just an
idea, cause I'm getting crazy!!!
Please ask me, if you need further information...
Thank you all!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTindy0g6%2BwLwZMRxz8QZTjOgV4Y75Epr9-JcKevp>