From owner-freebsd-questions@FreeBSD.ORG Thu Apr 22 04:53:15 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 536E216A4CF for ; Thu, 22 Apr 2004 04:53:15 -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 1657843D5F for ; Thu, 22 Apr 2004 04:53:12 -0700 (PDT) (envelope-from arek@wup-katowice.pl) Received: from poczta (localhost.localdomain [127.0.0.1]) by poczta (Postfix) with SMTP id 050B2256DE3 for ; Thu, 22 Apr 2004 15:17:42 +0200 (CEST) Received: from wup-katowice.pl (arek.wup-katowice.pl [213.216.67.82]) by poczta.wup-katowice.pl (Postfix) with ESMTP id D12F3256D60 for ; Thu, 22 Apr 2004 15:17:41 +0200 (CEST) Message-ID: <4087B24F.6020607@wup-katowice.pl> Date: Thu, 22 Apr 2004 13:53:51 +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: Newbie: ipfw and my own DNS 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, 22 Apr 2004 11:53:15 -0000 Hi I have firewall based on rc.firewall: #!/bin/sh fwcmd="/sbin/ipfw" ${fwcmd} -f flush ${fwcmd} add 100 pass all from any to any via lo0 ${fwcmd} add 200 deny all from any to 127.0.0.0/8 ${fwcmd} add 300 deny ip from 127.0.0.0/8 to any ${fwcmd} -f flush oif="fxp0" iif="fxp1" # Stop spoofing #${fwcmd} add deny all from ${inet}:${imask} to any in via ${oif} #${fwcmd} add deny all from ${onet}:${omask} to any in via ${iif} # Stop RFC1918 nets on the outside interface ${fwcmd} add deny all from any to 10.0.0.0/8 via ${oif} ${fwcmd} add deny all from any to 172.16.0.0/12 via ${oif} ${fwcmd} add deny all from any to 192.168.0.0/16 via ${oif} # Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1, # DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E) # on the outside interface ${fwcmd} add deny all from any to 0.0.0.0/8 via ${oif} ${fwcmd} add deny all from any to 169.254.0.0/16 via ${oif} ${fwcmd} add deny all from any to 192.0.2.0/24 via ${oif} ${fwcmd} add deny all from any to 224.0.0.0/4 via ${oif} ${fwcmd} add deny all from any to 240.0.0.0/4 via ${oif} #NAT ${fwcmd} add divert natd all from any to any via ${oif} # Stop RFC1918 nets on the outside interface ${fwcmd} add deny all from 10.0.0.0/8 to any via ${oif} ${fwcmd} add deny all from 172.16.0.0/12 to any via ${oif} ${fwcmd} add deny all from 192.168.0.0/16 to any via ${oif} # Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1, # DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E) # on the outside interface ${fwcmd} add deny all from 0.0.0.0/8 to any via ${oif} ${fwcmd} add deny all from 169.254.0.0/16 to any via ${oif} ${fwcmd} add deny all from 192.0.2.0/24 to any via ${oif} ${fwcmd} add deny all from 224.0.0.0/4 to any via ${oif} ${fwcmd} add deny all from 240.0.0.0/4 to any via ${oif} # Allow TCP through if setup succeeded ${fwcmd} add pass tcp from any to any established # Allow IP fragments to pass through ${fwcmd} add pass all from any to any frag # Allow setup of incoming email ${fwcmd} add pass tcp from any to me 25 setup # Allow access to our DNS ${fwcmd} add pass tcp from any to me 53 setup ${fwcmd} add pass udp from any to me 53 ${fwcmd} add pass udp from me 53 to any # Allow access to our WWW ${fwcmd} add pass tcp from any to me 80 setup # Allow access to our POP3S ${fwcmd} add pass tcp from any to me 995 setup # Allow access to our SMTP ${fwcmd} add pass tcp from any to me 25 setup # Reject&Log all setup of incoming connections from the outside ${fwcmd} add deny log tcp from any to any in via ${oif} setup # Allow setup of any other TCP connection ${fwcmd} add pass tcp from any to any setup # Allow DNS queries out in the world ${fwcmd} add pass udp from me to any 53 keep-state ${fwcmd} add pass udp from any to any 53 keep-state last rule is default deny all any to any And now problem: when i try check something in dns i don't have connection: [root@poczta ~]# nslookup poczta.wup-katowice.pl *** Can't find server name for adress 213.216.67.81: Time out This IP is fxp1 on server. sockstat show: bind named 588 20 udp4 213.216.67.81:53 *:* bind named 588 21 tcp4 213.216.67.81:53 *:* Wher is error in rules? If anybody can help me? Thank you Arek -- 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."