From owner-freebsd-net@FreeBSD.ORG Mon May 12 13:14:22 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63EB8106566B for ; Mon, 12 May 2008 13:14:22 +0000 (UTC) (envelope-from slawek.zak@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id 20AB78FC26 for ; Mon, 12 May 2008 13:14:21 +0000 (UTC) (envelope-from slawek.zak@gmail.com) Received: by an-out-0708.google.com with SMTP id b33so537549ana.13 for ; Mon, 12 May 2008 06:14:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=0VFcoGbFMl42KFoYUDNg4bivPpsB8ac6hN3X4Pf0YE8=; b=U36c/yu3WdGBvSJrsiSAhvJ43fRnG7dUDp5dP9mBU4hwsj9AqxZ75DLQLksc0SBWx9/KE/hK2gVIWNscc9lL6uxe0QJlrvCU1v8qR7NsVSK3CWW7G5dolFGFwWGJKPtufMX03hJ8ynfKjbehEdCJUI5P/Q2o/UbWg+4kkQP096I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=NhKxz5EsYtz15osF1xmIt6TCS/dGSphp14YhbUMPVCGxTCw7I7NXbALgmbJa1HGS/tXiFSiM/Vai37T6w03u6E5PnursC2hT/R9rlXHAHxdf325sklkjlSFfvlU95lLViOh8aXcH+E2cBzQbXuvSZyiHbKHlelSSEFHdoBnmbFA= Received: by 10.100.214.3 with SMTP id m3mr8027456ang.81.1210596590767; Mon, 12 May 2008 05:49:50 -0700 (PDT) Received: by 10.100.213.17 with HTTP; Mon, 12 May 2008 05:49:50 -0700 (PDT) Message-ID: <787bbe1c0805120549m8d80979t3932d091608dbbfa@mail.gmail.com> Date: Mon, 12 May 2008 14:49:50 +0200 From: "Slawek Zak" To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: PF NAT and IPSec (ESP) not working X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2008 13:14:22 -0000 Hi, I probably do something wrong, and I can't seem to get NAT in PF working with IPSec tunnel mode. Here's the network diagram: (172.16.0.0/16) internal network-- remote end of tunnel AA.AA.AA.AA --- XX.XX.XX.XX re0 (Internet) ----- enc (IPSec) ---- ZZ.ZZ.ZZ.ZZ gif1 --- tun0 --- YY.YY.YY.YY/24 OpenVPN clients I want OpenVPN clients to be NAT'ed to ZZ.ZZ.ZZ.ZZ and then enter the ipsec tunnel, be encrypted and land on the other side. When I've setup NAT using following PF rule: nat pass log on enc0 inet from YY.YY.YY.YY/24 to 172.16.0.0/16 -> ZZ.ZZ.ZZ.ZZ the packets go out on gif1 but are not encrypted (no traffic on enc0). Same for following NAT rule: nat pass log on enc0 inet from YY.YY.YY.YY/24 to 172.16.0.0/16 -> ZZ.ZZ.ZZ.ZZ Help, please! Thanks, /S