From owner-freebsd-questions@FreeBSD.ORG Fri Mar 7 15:32:58 2008 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 B2DB31065674 for ; Fri, 7 Mar 2008 15:32:58 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.freebsd.org (Postfix) with ESMTP id 790C28FC28 for ; Fri, 7 Mar 2008 15:32:58 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.2/8.14.2) id m27FWv20099392; Fri, 7 Mar 2008 09:32:57 -0600 (CST) (envelope-from dan) Date: Fri, 7 Mar 2008 09:32:56 -0600 From: Dan Nelson To: Siraj Shaikh Message-ID: <20080307153256.GA69157@dan.emsphone.com> References: <3b2ddd940803062347w3fefeb72w519ac28ca73f24d7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3b2ddd940803062347w3fefeb72w519ac28ca73f24d7@mail.gmail.com> X-OS: FreeBSD 7.0-PRERELEASE User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-questions@freebsd.org Subject: Re: Manually opening TCP ports 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: Fri, 07 Mar 2008 15:32:58 -0000 In the last episode (Mar 07), Siraj Shaikh said: > I am just wondering if there is a utility (or any feature in FreeBSD) > that allows me to manually open a TCP port on a machine. I am looking > for a way that could either allow me to open ALL or many TCP ports on > a machine. > > Also, is there any way of running a service on more than a single > port, or on all or many ports? If you are concerned about managing 65000 listening sockets ports in a single process, you can write a single ipfw rule to collapse many incoming ports into a single one, so you only have to open one listening socket in your program: ipfw add 1300 fwd 127.0.0.1,7000 tcp from any to me dst-port 7000-8000 The correct answer to your question really depends on why you need to open so many ports in the first place. -- Dan Nelson dnelson@allantgroup.com