From owner-freebsd-bugs@freebsd.org Fri Sep 2 12:30:02 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8789BCCB06 for ; Fri, 2 Sep 2016 12:30:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B831EE77 for ; Fri, 2 Sep 2016 12:30:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u82CU2ZO073870 for ; Fri, 2 Sep 2016 12:30:02 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 212331] pfil processing order Date: Fri, 02 Sep 2016 12:30:02 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.3-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: srijan.nandi@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2016 12:30:02 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212331 Bug ID: 212331 Summary: pfil processing order Product: Base System Version: 10.3-STABLE Hardware: i386 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: srijan.nandi@gmail.com CC: freebsd-i386@FreeBSD.org CC: freebsd-i386@FreeBSD.org Created attachment 174315 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D174315&action= =3Dedit Packet Capture Hello Everyone, I am running FreeBSD 10.3-RELEASE-p7. The setup that I have is, that I have 2 WAN interfaces and 1 LAN interface.= I have configure both IPFW (for Traffic Shaping and Captive Portal) and PF for all other filtering and nat rules. em0 - LAN em1 - WAN1 em2 - WAN2 My scenario is that as soon as a connection is made to a website, IPFW catc= hes this port 80 traffic and redirects it to a Captive Portal listening on port 9000 and then after authentication is successful via Captive Portal, the traffic is then passed onto PF for further processing. Here are the relevant IPFW rules: 1. For Captive Portal [code] add 5000 fwd 127.0.0.1,8000 tcp from any to any dst-port 443 in via em0 add 5000 allow ip from any to any dst-port 443 via em0 add 5000 fwd 127.0.0.1,9000 tcp from any to any dst-port 80 in via em0 add 5000 allow ip from any to any dst-port 80 via em0 [/code] 2. Allow authenticated traffic to PF [code] add 65533 pass ip from any to any [/code] PF upon receiving these packets makes a connection to the website and it op= ens up. As can be see from the rule below: [code] pass in quick on em0 inet from 172.16.1.0/24 to any flags S/SA keep state [/code] Everything works pretty well. However, as soon as I apply a route-to rule in PF, the processing order bre= aks. So now, no longer does IPFW get the port 80 traffic to be redirected to port 9000. It simply passes it outside. PF rule with rout-to set: [code] pass in quick on em0 route-to (pppoe0 X.X.X.X) inet from 172.16.1.0/24 to a= ny flags S/SA keep state. [/code] I require the processing to be such that for incoming traffic, IPFW should process the packets first and then pass it on to PF. This works when route-= to is not set. Attached is a tcpdump, explaining the same. Any help will be highly appreciated. I have been banging my head around this issue for days. --=20 You are receiving this mail because: You are the assignee for the bug.=