DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Security

FreeBSD Security Securing FreeBSD.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 10th March 2011
MatCauthon MatCauthon is offline
New User
 
Join Date: Mar 2011
Posts: 3
Thanked 0 Times in 0 Posts
Default FreeBSD 7, pf, carp, pfsync

G'day Mate! I' ve discovered just today this useful forum: I'm pleased to join you!
My first post is about a weird problem encountered few days ago...

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. "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:
Quote:
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:
Quote:
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.
Well... All my interfaces are UP... now I don't know how to check if pfsync is synched or not...

Meanwhile, in B node:
Quote:
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... :
Quote:
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:

Quote:
fwA# pfctl -ss | wc -l
5833
fwB# pfctl -ss | wc -l
5507
Could it be important?


Some additional information:
Quote:
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="a.a.a.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"
Quote:
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="151.12.49.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:
Quote:
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!
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
CARP Abbass OpenBSD Security 3 13th April 2011 07:22 PM
pfsync and pf.conf tenderoni OpenBSD Security 1 8th October 2010 07:48 PM
Clustering with CARP revzalot OpenBSD General 10 17th September 2009 04:44 AM
pfsync+carp+wifi firewall redundancy inquiry revzalot OpenBSD Security 1 18th May 2009 03:06 PM
carp configuration ohhcarp OpenBSD General 3 16th April 2009 10:50 PM


All times are GMT. The time now is 05:10 AM.


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