From owner-freebsd-questions@FreeBSD.ORG Thu Apr 15 06:03:23 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 5CD0D16A4CE for ; Thu, 15 Apr 2004 06:03:23 -0700 (PDT) Received: from poczta.wup-katowice.pl (wup.katowice.pik-net.pl [213.216.66.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD12443D53 for ; Thu, 15 Apr 2004 06:03:22 -0700 (PDT) (envelope-from arek@wup-katowice.pl) Received: from poczta (localhost.localdomain [127.0.0.1]) by poczta (Postfix) with SMTP id 4E3B0256D62 for ; Thu, 15 Apr 2004 16:27:07 +0200 (CEST) Received: from wup-katowice.pl (arek.wup-katowice.pl [213.216.67.82]) by poczta.wup-katowice.pl (Postfix) with ESMTP id 1BFCF256D61 for ; Thu, 15 Apr 2004 16:27:07 +0200 (CEST) Message-ID: <407E8830.2080100@wup-katowice.pl> Date: Thu, 15 Apr 2004 15:03:44 +0200 From: Arek Czereszewski User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7a) Gecko/20040219 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: natd (again) :( X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: arek@wup-katowice.pl List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2004 13:03:23 -0000 Hi, I'm newbie in ipfw and natd. Config like this: fxp0 - IP public (to my ISP) fxp1 - IP public 213.216.67.81 (on this IP work www, mail, dns and ftp) and 10 workstations with public IP conected fxp1_alias - 192.168.0.1 fxp1 conect to LAN (in LAN 10 workstations from my subnet 213.216.67.80/28 and 150 from 192.168.0.0/24). In /etc/rc.conf: ... gateway_enable="YES" firewall_enable="YES" #firewall_type="OPEN" firewall_script="/etc/fwrules" natd_enable="YES" natd_interface="fxp0" // is this correct?? natd_flags="-f /etc/natd.conf" ... /etc/fwrules fwcdm="/sbin/ipfw" $fwcdm -f flush # lo0 $fwcdm add 40 pass all from any to any via lo0 $fwcdm add 41 deny all from any to 127.0.0.0/8 $fwcdm add 42 deny all from 127.0.0.0/8 to any $fwcdm add 50 divert natd all from any to any via fxp0 $fwcdm add 51 allow tcp from any to me 53 setup $fwcdm add 52 allow udp from any to me 53 $fwcdm add 53 allow tcp from any to me 80 setup $fwcdm add 54 allow tcp from any to me 25 setup $fwcdm add 55 allow tcp from any to me 995 setup $fwcdm add 60 allow tcp from 192.168.0.0/24 to any 53 setup $fwcdm add 61 allow udp from 192.168.0.0/24 to any 53 keep-state $fwcdm add 62 allow tcp from 192.168.0.0/24 to any 80 setup $fwcdm add 63 allow tcp from 192.168.0.0/24 to any 8074 setup $fwcdm add 64 allow tcp from 192.168.0.0/24 to me 25 setup $fwcdm add 65 allow tcp from 192.168.0.0/24 to me 995 setup $fwcdm add 66 fwd 213.216.67.91,8080 tcp from 192.168.0.0/24 to any 80 $fwcdm add 67 deny all from 192.168.0.0/24 to any $fwcdm add 80 allow tcp from 213.216.67.80/28 to any 53 setup $fwcdm add 81 allow udp from 213.216.67.80/28 to any 53 keep-state $fwcdm add 82 allow tcp from 213.216.67.80/28 to any 80 setup $fwcdm add 83 allow tcp from 213.216.67.80/28 to any 8074 setup $fwcdm add 84 allow tcp from 213.216.67.80/28 to me 25 setup $fwcdm add 85 allow tcp from 213.216.67.80/28 to me 995 setup $fwcdm add 86 allow tcp from any to 213.216.67.92 113 setup $fwcdm add 87 allow tcp from 213.216.67.92 to 150.254.64.64 6667 $fwcdm add 88 deny all from 213.216.67.80/28 to any $fwcdm add 65000 deny log ip from any to any And now question: Is this rules OK? I don't connect server to internet before check rules. So if anybody can tell me what could i change, i do this. Or is this correct, and i can put server to internet. All man and how-to talk about 1 public and 1 private IP so i don't know what put in rules. Is anybody can help me? Thank you, Arek P.S. My english is awful, sorry. -- Arek Czereszewski | jid: aro(at)chrome.pl arek(at)wup-katowice.pl | gg: 1349941 "*nix is like a wigwam: no windows, no gates, apache inside."