From owner-freebsd-ipfw@FreeBSD.ORG Fri Mar 28 17:45:13 2003 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 933CC37B401 for ; Fri, 28 Mar 2003 17:45:09 -0800 (PST) Received: from jumpgate.cpn.homeip.net (CPE-144-137-16-170.vic.bigpond.net.au [144.137.16.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id B553543FBD for ; Fri, 28 Mar 2003 17:45:07 -0800 (PST) (envelope-from Carey.Nairn@dpac.tas.gov.au) Received: from arcturus.dpac.tas.gov.au (arcturus.cpn.homeip.net [172.16.1.5]) h2T1j36R023957 for ; Sat, 29 Mar 2003 12:45:04 +1100 (EST) (envelope-from Carey.Nairn@dpac.tas.gov.au) Message-Id: <5.1.0.14.0.20030329123307.040e9880@mail.cpn.homeip.net> X-Sender: cpn@mail.cpn.homeip.net X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sat, 29 Mar 2003 12:43:52 +1100 To: freebsd-ipfw@freebsd.org From: Carey Nairn Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: IPFW and ntpd X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2003 01:45:15 -0000 I am having a problem with getting ntpd to work with ipfw. Using my simple firewall setup (based on the default /etc/rc.firewall), I get the following error when I start ntpd: ntpd_initres[23825]: send to NTP server failed: Permission denied If I set my firewall to OPEN, ntpd works just fine. My firewall configuration is executed whenever my PPP (ADSL) connection is established and is as follows: #!/bin/sh fwcmd="/sbin/ipfw" ${fwcmd} -f flush oif="tun0" oip=`/sbin/ifconfig tun0 | grep -v grep | grep "inet " | awk '{ print $2 }'` onet=$oip omask="255.0.0.0" iif="fxp0" inet="172.16.1.0" imask="255.255.255.0" iip="172.16.1.4" ${fwcmd} add pass all from ${iip} to ${inet}:${imask} ${fwcmd} add pass all from ${inet}:${imask} to ${iip} # Deny incoming ICMP requests ${fwcmd} add deny log icmp from any to any in via ${oif} icmptypes 8 # Allow outgoing ICMP requests ${fwcmd} add pass icmp from any to any out via ${oif} icmptypes 8 ${fwcmd} add pass icmp from any to any in via ${oif} icmptypes 0 # 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 draft-manning-dsua-01.txt nets on the outside interface ${fwcmd} add deny all from 0.0.0.0/8 to any via ${oif} ${fwcmd} add deny all from any to 0.0.0.0/8 via ${oif} ${fwcmd} add deny all from 169.254.0.0/16 to any via ${oif} ${fwcmd} add deny all from any to 169.254.0.0/16 via ${oif} ${fwcmd} add deny all from 192.0.2.0/24 to any via ${oif} ${fwcmd} add deny all from any to 192.0.2.0/24 via ${oif} ${fwcmd} add deny all from 224.0.0.0/4 to any via ${oif} ${fwcmd} add deny all from any to 224.0.0.0/4 via ${oif} ${fwcmd} add deny all from 240.0.0.0/4 to any via ${oif} ${fwcmd} add deny all from any to 240.0.0.0/4 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 access to ssh ${fwcmd} add pass tcp from any to ${oip} 22 setup ${fwcmd} add pass tcp from any to ${oip} 22 # Allow setup of incoming email ${fwcmd} add pass tcp from any to ${oip} 25 setup # Allow access to our WWW ${fwcmd} add pass tcp from any to ${oip} 80 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 any 53 to ${oip} ${fwcmd} add pass udp from ${oip} to any 53 # Allow NTP queries out in the world ${fwcmd} add pass udp from ${oip} to any 123 keep-state any thoughts on why the ntp rule fails? thanks Carey Nairn