From owner-freebsd-pf@FreeBSD.ORG Tue Nov 4 09:38:08 2008 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C83311065672 for ; Tue, 4 Nov 2008 09:38:08 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA01.westchester.pa.mail.comcast.net (qmta01.westchester.pa.mail.comcast.net [76.96.62.16]) by mx1.freebsd.org (Postfix) with ESMTP id 72C048FC14 for ; Tue, 4 Nov 2008 09:38:08 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA10.westchester.pa.mail.comcast.net ([76.96.62.28]) by QMTA01.westchester.pa.mail.comcast.net with comcast id axap1a0070cZkys51xe7bz; Tue, 04 Nov 2008 09:38:07 +0000 Received: from koitsu.dyndns.org ([69.181.141.110]) by OMTA10.westchester.pa.mail.comcast.net with comcast id axe01a00E2P6wsM3Wxe198; Tue, 04 Nov 2008 09:38:07 +0000 X-Authority-Analysis: v=1.0 c=1 a=T2B_cOh0iMAA:10 a=nl8DGsr-ROMA:10 a=QycZ5dHgAAAA:8 a=SM0CpC2kzljQxVL6d0MA:9 a=0nkXmo7RI8iCSUzaDxAA:7 a=T4eI4mkpxv4E9J8pAHCeKuqT_eIA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id 53034C9419; Tue, 4 Nov 2008 01:38:00 -0800 (PST) Date: Tue, 4 Nov 2008 01:38:00 -0800 From: Jeremy Chadwick To: Matthias Kellermann Message-ID: <20081104093800.GA43676@icarus.home.lan> References: <491012AE.7000409@adminlife.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <491012AE.7000409@adminlife.net> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-pf@freebsd.org Subject: Re: rdr rule does not work (bad hdr length) X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 09:38:08 -0000 On Tue, Nov 04, 2008 at 10:15:26AM +0100, Matthias Kellermann wrote: > Hi list, > > I'm trying to set up a simple rdr rule in pf (7.0-RELEASE-p5). > > I have two hosts - host a (192.168.0.250) and host b (192.168.0.10) - in > a local network and want to forward one port from host a to host b. > > host a is the pf host. This is the rule to redirect traffic from host a > to b: > > rdr proto tcp from any to 192.168.0.250 port 23 -> 192.168.0.10 > pass log (all) proto tcp from any to 192.168.0.10 port 23 synproxy state > > If I try to get a telnet connection from my client 192.168.0.51 the > connection gets stuck and nothing happens. This is the output of tcpdump > on the pflog0 interface: > > # tcpdump -netttvvi pflog0 > 000000 rule 0/0(match): pass in on sis0: (tos 0x10, ttl 64, id 26668, > offset 0, flags [DF], proto TCP (6), length 60) 192.168.0.51.54460 > > 192.168.0.10.23: [|tcp] > 000266 rule 0/0(match): pass out on sis0: (tos 0x10, ttl 64, id 25527, > offset 0, flags [DF], proto TCP (6), length 44) 192.168.0.51.54460 > > 192.168.0.10.23: tcp 24 [bad hdr length 0 - too short, < 20] > > Anybody has an idea whats wrong here? This is not a pf problem. tcpdump's snaplen defaults to 56 bytes, which is too small when reading from pflog. Use the -s flag to increase the snaplen to 256 bytes, for example. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |