From owner-freebsd-questions@FreeBSD.ORG Mon Aug 10 20:30:04 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C942C106566B for ; Mon, 10 Aug 2009 20:30:04 +0000 (UTC) (envelope-from amig@amig.no) Received: from engage.amig.no (engage.amig.no [85.252.162.11]) by mx1.freebsd.org (Postfix) with ESMTP id 4E99F8FC15 for ; Mon, 10 Aug 2009 20:30:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by engage.amig.no (Postfix) with ESMTP id BCBB72FE832 for ; Mon, 10 Aug 2009 22:12:37 +0200 (CEST) X-Virus-Scanned: amavisd-new at engage.amig.no Received: from engage.amig.no ([127.0.0.1]) by localhost (mail.internal.amig.no [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hE4g3c-ojFzP for ; Mon, 10 Aug 2009 22:12:33 +0200 (CEST) Received: from SECTION10 (10.84-49-222.nextgentel.com [84.49.222.10]) by engage.amig.no (Postfix) with ESMTPA id 1149E2FEAC9 for ; Mon, 10 Aug 2009 22:12:33 +0200 (CEST) From: "Jan Aage Knutsen" To: Date: Mon, 10 Aug 2009 22:12:03 +0200 Message-ID: <000901ca19f6$d3da2aa0$7b8e7fe0$@no> MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoZ9CQP3BAXvEKyTNmBCQ8rmH2dbAAAVkwg Content-Language: no Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Route outgoing traffic on jail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2009 20:30:05 -0000 Hi, Im trying to route the outgoing traffic from a jail trough another gw than the default one set on host with pf. The host is using internal address 192.168.10.5 and the default route is to 192.168.10.1 wich is a dsl line. The jail is using a public ip that is on a fiber line where the gw is at the isp and not in my place. I got a /29 from them. I want this jail to use the isp gw and not the default route. So far I managed to get the reply-to rule to work. So traffic originating from inet to jail works. But the inet traffic originating from the jail still goes trough the defaultroute. I also using trunking on the interface and have multiple vlans on it. And the vlan traffic works fine. I can ping the isp1 gw from host etc. Here is my pf config. ############### # Variables # ############### if_isp1="vlan2" if_isp2="vlan1" gw1="x.x.x.1" gw2="192.168.21.1" jail_ip="x.x.x.30" ############### # Rules # ############### #routing for isp1 pass in on $if_isp1 reply-to (vlan2 $gw1) from any to any keep state <-this is the rule that works.. pass out on $if_isp1 route-to ($if_isp1 $gw1 ) from $jail_ip to any <- tried to mess around with this rule, Any good ideas out there? I also running 8.0 fyi. Regards Jan Aage