From owner-freebsd-net Tue Mar 6 18:37:18 2001 Delivered-To: freebsd-net@freebsd.org Received: from lotl.clari.net.au (lotl.clari.net.au [203.26.127.210]) by hub.freebsd.org (Postfix) with ESMTP id 22C0E37B719 for ; Tue, 6 Mar 2001 18:37:13 -0800 (PST) (envelope-from stephen@clari.net.au) Received: from theforce.clari.net.au (theforce.clari.net.au [203.8.14.120]) by lotl.clari.net.au (8.9.3/8.9.1) with ESMTP id NAA02600; Wed, 7 Mar 2001 13:36:37 +1100 (EST) (envelope-from stephen@clari.net.au) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3AA58CBF.819707E6@isi.edu> Date: Wed, 07 Mar 2001 13:43:10 +1100 (EST) Organization: ClariNET Internet Solutions From: Stephen Cimarelli To: Lars Eggert Subject: Re: IPSEC + natd + IPFW Cc: freebsd-net@FreeBSD.ORG Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 07-Mar-01 Lars Eggert wrote: > Stephen Cimarelli wrote: >> I have managed to get IPsec+gif tunelling to work but am having trouble >> setting >> up firewal rules, it seem that recieved ESP packets pass through the >> firewall >> rule set twice and hit my natd divert rules. > > Do you use IPsec tunnel mode, or IPsec transport mode + gif tunnels to do > the tunneling? Well this is where it starts to get funny, I have 2 HOWTOs Both HOWTO's use gif tunnels, but the FreeBSD IPsec mini-HOWTO uses IPsec transport + gif tunnels and The IPSEC VPN tunnel on freeBSD 4.x howto uses IPsec tunnel + gif tunnels ------------------------------ For me only IPsec tunnel + gif tunnels works. >Also, in the ipfw rules below, your "via" clauses reference > tun0, which is neither gif nor IPsec tunneling. Yes but rules 110 and 115 are what I added to get it to work with natd, with out those rules ESP packets coming back in where getting diverted at rules 120, It seem has if the ESP where geting decoded and than getting internally feed back through the ipfw rules. > >> Toget around this I had to add a rule like 00110 and 00115 >> >> 00001 150 20400 count esp from any to any >> 00010 150 20400 allow esp from any to any in recv tun0 >> 00011 0 0 allow esp from any to any out xmit tun0 >> 00110 1560 231661 allow ip from 192.168.0.0/16 to 192.168.0.0/16 >> 00115 9 756 allow ip from 10.10.0.0/16 to 192.168.0.0/16 via tun0 >> 00120 6193 2543953 divert 8668 tcp from any to any out xmit tun0 >> 00120 15 1233 divert 8668 udp from any to any out xmit tun0 >> 00120 0 0 divert 8668 icmp from any to any out xmit tun0 >> 00121 6132 6364485 divert 8668 tcp from any to any in recv tun0 >> 00121 16 3516 divert 8668 udp from any to any in recv tun0 >> 00121 21 1764 divert 8668 icmp from any to any in recv tun0 > -- > Lars Eggert Information Sciences Institute > http://www.isi.edu/larse/ University of Southern California ---------------------------------- E-Mail: Stephen Cimarelli Date: 07-Mar-01 Time: 13:28:07 ClariNet Internet Solutions +61 3 9486 0811 www.clari.net.au ---------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message