From owner-freebsd-questions Mon Apr 16 9:43:50 2001 Delivered-To: freebsd-questions@freebsd.org Received: from femail1.sdc1.sfba.home.com (femail1.sdc1.sfba.home.com [24.0.95.81]) by hub.freebsd.org (Postfix) with ESMTP id 8C5D337B43E for ; Mon, 16 Apr 2001 09:43:45 -0700 (PDT) (envelope-from wtem@olywa.net) Received: from [10.0.0.3] ([65.0.217.10]) by femail1.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20010416164315.LVTR24191.femail1.sdc1.sfba.home.com@[10.0.0.3]> for ; Mon, 16 Apr 2001 09:43:15 -0700 Mime-Version: 1.0 X-Sender: wtem@mail.olywa.net Message-Id: Date: Mon, 16 Apr 2001 09:43:41 -0700 To: freebsd-questions@FreeBSD.ORG From: Walter McGinnis Subject: another natd port forwarding question Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello everyone, I've been searching the archive and trying different recipes for getting port forwarding to work between a public box and a internal development box. I think I have most things in order, but I still can't get it to work. BTW, I encourage everyone to be better about listing their version number when posting their problem or solutions. I suspect that I have gone down a few dead ends because I followed directions for earlier versions. Anyway, here is my situation: Cable modem talks to a FreeBSD 4.0-RELEASE box with two NICs. One for a the cable, one for the LAN hub. Everything works fine except I have a RH web development box on the LAN that I would like to have port 8000 - 9000 be viewable from the outside world. These ports are not used on the FreeeBsd box. I decided to test by setting up port 8003 on the public FreeBsd box to forward to 10.0.0.10:8003 (the RH web development box). On a side note if I am going to use an additional file for natd configuration it seems like I should consolidate all my flags into it (except, of course, the call to the config file). A quick note for for how to include the current appropriate flags in the natd.conf file would be appreciated. I'm obviously missing something: excerpt from rc.firewall ############ # These rules are required for using natd. All packets are passed to # natd before they encounter your remaining rules. The firewall rules # will then be run again on each packet after translation by natd, # minus any divert rules (see natd(8)). # case ${natd_enable} in [Yy][Ee][Ss]) if [ -n "${natd_interface}" ]; then ${fwcmd} add divert natd all from any to any via ${natd_interface\ } fi ;; esac ${ipfw} allow log tcp from any to xxx.xxx.xxx.xxx 8003 via ${oif} ############ the file rc.conf # -- sysinstall generated deltas -- # linux_enable="YES" gateway_enable="YES" router_enable="YES" sendmail_enable="NO" firewall_enable="YES" firewall_type="open" firewall_quiet="NO" natd_enable="YES" natd_interface="xl0" natd_flags="-u -m -dynamic -f /etc/natd.conf" tcp_extensions="NO" forward_sourceroute="NO" accept_sourceroute="NO" # -- named_enable="YES" -- # network_interfaces="xl0 lo0 rl0" ifconfig_xl0="inet xxx.xxx.xxx.xxx netmask 255.255.255.0" defaultrouter="xxx.xxx.xxx.xxx" hostname="13A.pinol1.sfba.home.com" # -- sysinstall generated deltas -- # ifconfig_rl0="inet 10.0.0.1 netmask 255.255.255.0" # -- sysinstall generated deltas -- # keymap="us.iso" /etc/natd.conf interface xl0 redirect_port tcp 10.0.0.10:8003 8003 Thanks in advance for your answers, Walter McGinnis To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message