Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Apr 2006 20:58:03 +0300
From:      Giorgos Keramidas <keramida@FreeBSD.org>
To:        Brett Proctor <brettproctor@gmail.com>
Cc:        freebsd-doc@FreeBSD.org
Subject:   Re: 26.6 IPFW: Couple things
Message-ID:  <20060420175803.GA2732@gothmog.pc>
In-Reply-To: <3e19003d0604140442y29756ff5s3d05ff17a840575b@mail.gmail.com>
References:  <3e19003d0604140442y29756ff5s3d05ff17a840575b@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2006-04-14 04:42, Brett Proctor <brettproctor@gmail.com> wrote:
> First off, let me say thank you to whoever is responsible for writing
> all this. Really helpfull stuff. I implemented the NAT-ed statefull
> ruleset (the last example) and found a bug I believe. The offending
> line:
> # Allow out access to my ISP's Domain name server.
> # x.x.x.x must be the IP address of your ISP's DNS
> # Dup these lines if your ISP has more than one DNS server
> # Get the IP addresses from /etc/resolv.conf file
> $cmd 020 $skip tcp from any to x.x.x.x 53 out via $pif setup keep-state
> the TCP part should be UDP I believe. In some previous sections it
> seemed it listed both TCP and UDP rules for DNS, but I believe that
> DNS only uses TCP.

No, DNS uses both UDP and TCP, if necessary.

> Also, is this a bit logically inconsistent? (Very last line)
> # This is skipto location for outbound stateful rules
> $cmd 800 divert natd ip from any to any out via $pif
> $cmd 801 allow ip from any to any
>
> # Everything else is denied by default
> # deny and log all packets that fell through to see what they are
> $cmd 999 deny log all from any to any
>
> Isn't it impossible for anything to get past rule 801? Doesn't it
> essentially make it a default allow-all policy? If i'm not mistaken
> shouldn't rule 999 be moved and changed to 799?

Rule 801 should be removed, if you want to make this a deny-by-default
firewall.

This is an old post, but I only now found the time to read it in detail.
I'll check the current version of the Handbook "Firewall" chapter and
let you know if these comments still apply.

Thanks for the willingless to help us improving the docs :)

- Giorgos




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060420175803.GA2732>