From owner-freebsd-questions@FreeBSD.ORG Tue Jul 20 16:57:41 2010 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 C01DD1065686 for ; Tue, 20 Jul 2010 16:57:41 +0000 (UTC) (envelope-from norgaard@locolomo.org) Received: from mail.locolomo.org (97.pool85-48-194.static.orange.es [85.48.194.97]) by mx1.freebsd.org (Postfix) with ESMTP id 332AD8FC27 for ; Tue, 20 Jul 2010 16:57:41 +0000 (UTC) Received: from beta.local (business-088-079-092-162.static.arcor-ip.net [88.79.92.162]) by mail.locolomo.org (Postfix) with ESMTPSA id C3E7B1C0871; Tue, 20 Jul 2010 18:57:38 +0200 (CEST) Message-ID: <4C45D57F.2020506@locolomo.org> Date: Tue, 20 Jul 2010 18:57:35 +0200 From: Erik Norgaard User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.4) Gecko/20100608 Lightning/1.0b2 Thunderbird/3.1 MIME-Version: 1.0 To: google@alexus.org References: <4C3F91CF.5090206@locolomo.org> <4C419944.8030702@locolomo.org> <4C447F7F.6020308@locolomo.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: alexus , freebsd-questions@freebsd.org Subject: Re: ipnat.conf - map and rdr won't work! 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: Tue, 20 Jul 2010 16:57:41 -0000 On 20/07/10 18.02, alexus wrote: > On Mon, Jul 19, 2010 at 12:38 PM, Erik Norgaard wrote: >> On 19/07/10 16.46, alexus wrote: >> Can't help you more, really, you need to investigate where packets are >> dropped, tcpdump is a great tool and the man-page is excelent, can't explain >> it better, if you don't like tcpdump then use any other packet sniffing tool >> at hand, snort for example. > > ipmon: > > 20/07/2010 10:22:00.123106 @2 NAT:RDR 172.16.172.16,22<- -> > 64.52.58.58,22 [69.10.67.106,6346 PR tcp] > 20/07/2010 10:26:00.340436 @2 NAT:EXPIRE 172.16.172.16,22<- -> > 64.52.58.58,22 [69.10.67.106,6346 PR tcp] Pkts 11/0 Bytes 640/0 > > tcpdump: > > tcpdump: listening on fxp0, link-type EN10MB (Ethernet), capture size 96 bytes > 11:40:07.366519 IP (tos 0x0, ttl 49, id 48580, offset 0, flags [DF], > proto TCP (6), length 64) 69.10.67.106.9408> 64.52.58.58.22: S, cksum > 0xc05d (correct), 208454974:208454974(0) win 65535 1380,nop,wscale 3,nop,nop,timestamp 91387932 0,sackOK,eol> > 0 packets dropped by kernel What tcpdump options did you use, on what interface? where did you run it? on the hosting system or within the jail? >> Do packets can get dropped because of your firewall default policy? For >> stealth it may be set to simply drop packets which result in a connection >> time-out rather than send a TCP-RST. > i disabled ipfw, and i dont have any rules inside of ipfilter You do have the default rule. IIRC this is set when you compile ipfilter, it can be set to either block or pass. If you don't remember what it was, then you can override it by configuring two rules: pass in quick all pass out quick all >> Do you have any logs in the jail that indicate that the first packet is >> actually received? Do your firewall log connections? If not, see how you can >> enable logs on all rules to get more information. > > nothing gets to jail there for no logs inside of jail Ok, but you should be able to configure log on your firewall/nat rules. IIRC ipfilter does not permit log statement on nat rules, you can switch to packet filter it has almost same syntax and permits log. >> Can you connect out from the jail, to external servers? only to the jail >> hosting server? Did the jail's ssh log tell anything? > > no i can not connect out from jail, as map doesn't work either > nothing gets to Nor to the hosting system? >> You wrote you can connect with ssh from the hosting server to the jail, but >> it took a long time, did you investigate this? Is there some DNS issue that >> times out and causes the connection to fail? what about that "long time" I recall you mentioned? >> Can you ping your jail? Can you ping out? Default route is configured? > > i can ping my jail within host environment > once again nothing within jail works as map (nat) isn't working Are you sure you're actually ping'ing the jail? IIRC from your previous mail you have configured the jail IP both on the host environment and in the jail. So I suppose that from your host environment you can ssh into the jail? Did ssh start up, netstat -l? From the jail, can you ping the host environment? > default router isn't configured in rc.conf (inside of jail) as per > jail's man page its not needed > it was working fine before without it > >> There are tons of tests you can do to figure out what's failing. Do you have additional external ip addresses available? Last time I played around with jail, I had this: ifconfig_vr1="inet 172.16.0.1/23" # Hosting system ifconfig_vr1_alias0="inet 172.16.0.2/32" # Jail .... jail_test_ip="172.16.0.2" .... So that would create an alias for for the jail and bypasss the need for rdr. BR, Erik