From owner-freebsd-questions@FreeBSD.ORG Thu Feb 19 07:44:10 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ACE8F16A4D2 for ; Thu, 19 Feb 2004 07:44:10 -0800 (PST) Received: from mail.indatacorp.com (65.104.0.66.ptr.us.xo.net [65.104.0.66]) by mx1.FreeBSD.org (Postfix) with SMTP id 82F6643D2D for ; Thu, 19 Feb 2004 07:44:10 -0800 (PST) (envelope-from rgrafton@indatacorp.com) Received: (qmail 59222 invoked by uid 0); 19 Feb 2004 15:45:46 -0000 Received: from unknown (HELO ITDept) (rgrafton@indatacorp.com@192.168.100.119) by netfb01.indatacorp.com with SMTP; 19 Feb 2004 15:45:46 -0000 From: "Randy Grafton" To: "'Stanley Chan'" Date: Thu, 19 Feb 2004 08:52:32 -0700 Message-ID: <07ba01c3f700$6286adc0$7764a8c0@ITDept> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 In-Reply-To: <368CF33D.1EA0A4E1@cyberec.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-questions@freebsd.org Subject: RE: redirect port X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2004 15:44:10 -0000 Stanley, If you are using natd and have recompiled your kernel with the = appropriate options then this should work for you. These are entries to your /etc/rc.conf, (just a starting point, you can = fine tune to your needs): gateway_enable=3D"YES" firewall_enable=3D"YES" firewall_type=3D"OPEN" firewall_quiet=3D"YES" firewall_logging=3D"YES" natd_enable=3D"YES" natd_interface=3D"fxp0" natd_flags=3D"-f /etc/natd.conf" In the above statement natd_interface=3D"fxp0", fxp0 is the outside nic = of your system. Next put these statements in your /etc/natd.conf file as referenced = above, (natd.conf doesn't exist by default, you'll create it): same_ports yes dynamic yes redirect_port tcp inside_address:port outside_address:port redirect_port udp inside_address:port outside_address:port As shown above, don't forget to redirect udp traffic if the service = you're trying to facilitate needs it. Also know that the ports for the inside = and the outside don't have to match. For example, my service provider blocks http/port 80 traffic coming in to my connection so my statement in the natd.conf file would be something like: redirect_port 192.168.1.10:80 outside_address:8080 By doing so outside connectivity attempts to my isp assigned address = have to be stated as: http://outside_address:8080. FYI if you ever want to host gaming sessions on an inside system like Counter strike or Unreal Tournament, then put a couple of lines like = these in your natd.conf file, (these examples are ones that I used so that my buddies and I could blast away in Unreal Tournament): redirect_port tcp inside_address:7777-7781 outside_address:7777-7781 redirect_port udp inside_address:7777-7781 outside_address:7777-7781 As you make these changes you can apply them without restarting by = running /etc/netstart. Hope that helps. -Randy -----Original Message----- From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Stanley Chan Sent: Friday, January 01, 1999 9:10 AM To: questions@FreeBSD.org Subject: redirect port Dear Friends, The example in the NAT documents is sufficient, can anyone tell me how = to redirect ports in the NAT machine. How to put the following command in = the rc.conf ? I want to use one of the amchine behind the NAT to run web = server. -redirect_port tcp 192.168.0.2:6667 6667 -redirect_port tcp 192.168.0.3:80 80 Thanks Sanley _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to = "freebsd-questions-unsubscribe@freebsd.org"