From owner-freebsd-ipfw@freebsd.org Thu Feb 15 10:08:53 2018 Return-Path: Delivered-To: freebsd-ipfw@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBE9CF0F232 for ; Thu, 15 Feb 2018 10:08:53 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::608]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 399906EF7C for ; Thu, 15 Feb 2018 10:08:53 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 910244445F80; Thu, 15 Feb 2018 13:08:30 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id aIURIgv2U6-8U6WK0uu; Thu, 15 Feb 2018 13:08:30 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1518689310; bh=+Dui3MGsYHX1Kqe9NyRvpMpFRj7si+M0dbczTRNLWqw=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=UFgCI56mZbc1SMddOcDNnN6S1201bBoWVs3pXZ4DV50ZA8RPrqdrEMZQjcmZFre1G YNHvsA8AZsTafuCDpL09IGq+KmEXp1wv3fhAZOXe+/bkJsrLNnj4AFhKpjjzMgs2Sm Ecs3baedJQIuqxpYcWxI7fmXTxe46c0GfpXbW7T0= Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id boSEgyTXWq-8T4KHb9X; Thu, 15 Feb 2018 13:08:30 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1518689310; bh=+Dui3MGsYHX1Kqe9NyRvpMpFRj7si+M0dbczTRNLWqw=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=UFgCI56mZbc1SMddOcDNnN6S1201bBoWVs3pXZ4DV50ZA8RPrqdrEMZQjcmZFre1G YNHvsA8AZsTafuCDpL09IGq+KmEXp1wv3fhAZOXe+/bkJsrLNnj4AFhKpjjzMgs2Sm Ecs3baedJQIuqxpYcWxI7fmXTxe46c0GfpXbW7T0= Authentication-Results: smtp4o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: IPFW and FTP client behind NAT To: wishmaster , freebsd-ipfw@freebsd.org References: <1518588674.863238377.1k6sp25r@frv52.fwdcdn.com> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: <5a3df88d-0a08-08df-2851-38bf54940834@yandex.ru> Date: Thu, 15 Feb 2018 13:07:50 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1518588674.863238377.1k6sp25r@frv52.fwdcdn.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="A8fu1TzL0vOwLyE1Px5WFQWv0JabUKmh8" X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 10:08:54 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --A8fu1TzL0vOwLyE1Px5WFQWv0JabUKmh8 Content-Type: multipart/mixed; boundary="Y3ty6SCdWz0WbIM5tKTn3EObnan29Tsxn"; protected-headers="v1" From: "Andrey V. Elsukov" To: wishmaster , freebsd-ipfw@freebsd.org Message-ID: <5a3df88d-0a08-08df-2851-38bf54940834@yandex.ru> Subject: Re: IPFW and FTP client behind NAT References: <1518588674.863238377.1k6sp25r@frv52.fwdcdn.com> In-Reply-To: <1518588674.863238377.1k6sp25r@frv52.fwdcdn.com> --Y3ty6SCdWz0WbIM5tKTn3EObnan29Tsxn Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 14.02.2018 09:35, wishmaster wrote: > The issue is with the second remote server. When I transmit a very big = file, the control channel does not "recreated" and transmitting this file= and all the next is always fails. >=20 > root@xxx: ipfw -d show|grep '111.222.0.7' > 03200 2985778 2299927348 (300s) STATE tcp 111.222.0.253 63307 <-> 111= =2E222.0.7 44678 :nts > 03200 59 4622 (6s) STATE tcp 111.222.0.253 63623 <-> 111.2= 22.0.7 21 :nts >=20 > root@xxx: ipfw -d show|grep '111.222.0.7' > 03200 3137837 2414765852 (300s) STATE tcp 111.222.0.253 63307 <-> 111= =2E222.0.7 44678 :nts >=20 > The main server/router uses IPFW and in most places dynamic rules. Is w= orkaround I have added one rule on external interface: >=20 > $cmd 5153 allow log tcp from any 21 to any 1024-65535 # ipfw - ftp issu= e >=20 > But I want find the problem. ipfw starts send keep-alive TCP segments when dynamic state's lifetime is below than 20 seconds. If foreign host replies to keep-alive segment, the state's lifetime will be bumped up to 300 seconds (by default). Otherwise the state will be expired. In your case I guess the foreign host doesn't reply to keep-alive segments, probably due to it has lower value of state's lifetime. And when your host starts sending keep-alive requests, the foreign host has already dropped this state. You can try to decrease net.inet.ip.fw.dyn_ack_lifetime value and determine the value that will be enough for this host. For example, set it to 250, 200, 150, 100. --=20 WBR, Andrey V. Elsukov --Y3ty6SCdWz0WbIM5tKTn3EObnan29Tsxn-- --A8fu1TzL0vOwLyE1Px5WFQWv0JabUKmh8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlqFW/YACgkQAcXqBBDI oXoviwf+Pcu5BicozqY46FMqv3mx2zbmasVzef1L20ERy1kqg+b2D3JNbO3dgWjk R2XvxMJg2PkXIVM60Ul+ykbGh5XQbEvRP9ef7B/RRQ31WbKkrdR0N9ZpKyX7kYCq u8x6YKA1XJEYB6BACvaNuAsH0ejdeml+qJpedUjkPBYa9znigBF7KQ06fPSTpls2 QFDibxGjtPr1f7nYylb08HGj5fFLPcnftREuWrktsSyZwNPXs0kacpx7jl//WNUF Y3ORoPB+aS68pa3CRfkZ8VoHWmTK3lQ+3aGt2TPDp3hq4F/8SR0PC/pzfWw1v0Pu MEo4pXXb8t4mGrUwukS1wxpeP86uTQ== =A7WG -----END PGP SIGNATURE----- --A8fu1TzL0vOwLyE1Px5WFQWv0JabUKmh8--