From owner-freebsd-bugs Sun Apr 21 1:20:14 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 3A63837B417 for ; Sun, 21 Apr 2002 01:20:05 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3L8K5A83976; Sun, 21 Apr 2002 01:20:05 -0700 (PDT) (envelope-from gnats) Date: Sun, 21 Apr 2002 01:20:05 -0700 (PDT) Message-Id: <200204210820.g3L8K5A83976@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Crist J. Clark" Subject: Re: misc/37301: 4.5 rc.firewall type simple does not pass icmp, or inside to gateway udp Reply-To: "Crist J. Clark" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR misc/37301; it has been noted by GNATS. From: "Crist J. Clark" To: Earl Killian Cc: freebsd-gnats-submit@FreeBSD.ORG Subject: Re: misc/37301: 4.5 rc.firewall type simple does not pass icmp, or inside to gateway udp Date: Sun, 21 Apr 2002 01:19:05 -0700 On Sat, Apr 20, 2002 at 05:35:31PM -0700, Earl Killian wrote: > >Description: > I tried the 4.5-RELEASE rc.firewall with firewall_type="simple" and > natd_enable="YES", and I was not able to talk to my gateway machine > from the hosts on the inside. Looking at the rules below, I see only > one rule that is specific to iif, and that is just to prevent the > inside from pretending to be outside. Most of the rules are via oif, > or to oip and so don't apply to an inside machine talking to iip via > iif. If I eliminate those rules, I'm left with: > > Rules that apply to inet:imask talking to iip via iif: > > deny all from any to 127.0.0.0/8 > deny ip from 127.0.0.0/8 to any > deny all from ${onet}:${omask} to any in via ${iif} > pass tcp from any to any established > pass all from any to any frag > pass tcp from any to any setup > > So what about icmp and udp? You are missing, # Allow access to our DNS ${fwcmd} add pass tcp from any to ${oip} 53 setup ${fwcmd} add pass udp from any to ${oip} 53 ${fwcmd} add pass udp from ${oip} 53 to any Which allow internal machines to reach the DNS server on the gateway. Remember, ############ # This is a prototype setup for a simple firewall. Configure this # machine as a named server and ntp server, and point all the machines # on the inside at this machine for those services. ############ (Not that that the rules actually work for NTP. ;) > Do other sites really use this fw and > just not ping or dns/ntp to their gateway from inside? I hope no one uses it unmodified. You shouldn't. As it is documented elsewhere in rc.firewall, # For ``client'' and ``simple'' the entries below should be customized # appropriately. ############ # This is a prototype setup for a simple firewall. You should NOT use these rules as is. They don't make a lot of sense. Trying to make a default set of firewall rules is a fools game. No one would be happy with them. I'd prefer to have a completely broken set of rules. If you don't understand your own firewall rules, you shouldn't be building your own firewall. A false-sense of security is worse than having less security and knowing it. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message