From owner-freebsd-newbies@FreeBSD.ORG Thu Apr 15 02:05:37 2004 Return-Path: Delivered-To: freebsd-newbies@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 76BAB16A4CE for ; Thu, 15 Apr 2004 02:05:37 -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 7938143D54 for ; Thu, 15 Apr 2004 02:05:35 -0700 (PDT) (envelope-from arek@wup-katowice.pl) Received: from poczta (localhost.localdomain [127.0.0.1]) by poczta (Postfix) with SMTP id E6B71256D63 for ; Thu, 15 Apr 2004 12:17:59 +0200 (CEST) Received: from wup-katowice.pl (arek.wup-katowice.pl [213.216.67.82]) by poczta.wup-katowice.pl (Postfix) with ESMTP id A3794256D5E for ; Thu, 15 Apr 2004 12:17:59 +0200 (CEST) Message-ID: <407E4DCD.2010303@wup-katowice.pl> Date: Thu, 15 Apr 2004 10:54:37 +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-newbies@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Natd + 2 public IP and 1 alias X-BeenThere: freebsd-newbies@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: arek@wup-katowice.pl List-Id: Gathering place for new users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2004 09:05:37 -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="fxp1" // 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 8668 ip from 192.168.0.0/24 to any via fxp1 $fwcdm add 51 allow tcp from any to me 53 $fwcdm add 52 allow udp from any to me 53 $fwcdm add 53 allow tcp from any to me 80 $fwcdm add 54 allow tcp from any to me 25 $fwcdm add 55 allow tcp from any to me 995 $fwcdm add 60 allow tcp from 192.168.0.0/24 to any 53 $fwcdm add 61 allow udp from 192.168.0.0/24 to any 53 $fwcdm add 62 allow tcp from 192.168.0.0/24 to any 80 $fwcdm add 63 allow tcp from 192.168.0.0/24 to any 8074 $fwcdm add 64 allow tcp from 192.168.0.0/24 to me 25 $fwcdm add 65 allow tcp from 192.168.0.0/24 to me 995 $fwcdm add 66 fwd 213.216.67.91,8080 tcp from 192.168.0.0/24 to any 80 // it's OK for transparent proxy ? $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 $fwcdm add 81 allow udp from 213.216.67.80/28 to any 53 $fwcdm add 82 allow tcp from 213.216.67.80/28 to any 80 $fwcdm add 83 allow tcp from 213.216.67.80/28 to any 8074 $fwcdm add 84 allow tcp from 213.216.67.80/28 to me 25 $fwcdm add 85 allow tcp from 213.216.67.80/28 to me 995 $fwcdm add 86 allow tcp from any to 213.216.67.92 113 $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 # kill all ;) $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."