Date: Wed, 19 Dec 2007 09:11:45 +0200 From: Silver Salonen <silver.salonen@gmail.com> To: freebsd-pf@freebsd.org Subject: Re: occasional "Operation not permitted" on state-mismatch Message-ID: <200712190911.46211.silver.salonen@gmail.com> In-Reply-To: <fee88ee40712181144g55727367gf333e44c537d0b47@mail.gmail.com> References: <200712180934.58755.silver.salonen@gmail.com> <fee88ee40712181144g55727367gf333e44c537d0b47@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 18 December 2007 21:44, Kian Mohageri wrote: > On Dec 17, 2007 11:34 PM, Silver Salonen <silver.salonen@gmail.com> wrote: > > Hello! > > > > I have some FreeBSD-boxes (2x6.3-PRERELEASE (installed on 08.Dec), > > 1x6.2-RELEASE) with PF configured. They are connected with OpenVPN LAN-to-LAN > > and the problem is that a few times per hour connection drops between > > computers from one LAN to another. At first I blamed OpenVPN, then I blamed > > bridge, but now I've realized that the problem is in PF. > > So I've tried increasing TCP-timeouts and setting optimization > > to "aggressive", but well, it's still the same. > > > > I monitor connections by sending TCP packets once per second to some other > > host and wait for reply. I use Nagios-plugins' check_tcp for that. The script > > looks like: > > ===== > > while [ 1 ]; do > > pfctl -si |grep mismatch > > /usr/local/libexec/nagios/check_tcp -H $host -p $port -t 2 > > pfctl -si |grep mismatch > > sleep 1 > > done > > ===== > > > > My guess is that you're re-using a source port and are mismatching an > existing state on the source or destination host (or something in > between) because the state hasn't expired before the new connection > attempt takes place. > > Can't be sure though... > > -Kian Yup, googling a bit about openbsd, pf and "no route to host" turned up that it's "the port reuse issue". Although FreeBSD is supposed to be protected against it (http://www.freebsd.org/releases/4.11R/relnotes-i386.html#NET-PROTO), it seems not to be. So question is that how can I avoid the issue without removing keeping states from my rules. Actually I did the latter yesterday and connections started dropping as my default rule is to block everything. So now I'm keeping states on only outgoing connections and it's better this way, but not perfect though. -- Silver
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712190911.46211.silver.salonen>