From owner-freebsd-stable Sun Mar 25 10:59:45 2001 Delivered-To: freebsd-stable@freebsd.org Received: from femail8.sdc1.sfba.home.com (femail8.sdc1.sfba.home.com [24.0.95.88]) by hub.freebsd.org (Postfix) with ESMTP id 9613E37B71A for ; Sun, 25 Mar 2001 10:59:41 -0800 (PST) (envelope-from graywane@home.com) Received: from cg392862-a.adubn1.nj.home.com ([65.2.79.221]) by femail8.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20010325185941.KTSR26052.femail8.sdc1.sfba.home.com@cg392862-a.adubn1.nj.home.com>; Sun, 25 Mar 2001 10:59:41 -0800 Received: (from graywane@localhost) by cg392862-a.adubn1.nj.home.com (8.11.3/8.11.3) id f2PIxeO31313; Sun, 25 Mar 2001 13:59:40 -0500 (EST) (envelope-from graywane) Date: Sun, 25 Mar 2001 13:59:39 -0500 From: Graywane To: Randy Bush Cc: FreeBSD Stable Subject: Re: ipf idiot wants to roam Message-ID: <20010325135939.A31237@home.com> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from randy@psg.com on Sun, Mar 25, 2001 at 10:09:25AM -0800 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 25, 2001 at 10:09:25AM -0800, Randy Bush wrote: > # reserved addresses > # > block in log first quick from 10.0.0.0/8 to any > block in log first quick from 192.168.0.0/16 to any > block in log first quick from 172.16.0.0/12 to any > # > # loopback allows all packets > # > pass in quick on lo0 all > pass out quick on lo0 all I'd put lo0 at the top of your rules file and add the following to your reserved addresses blocking: 127.0.0.0/8 0.0.0.0/8 169.254.0.0/16 192.0.2.0/24 204.152.64.0/23 224.0.0.0/3 =20 The last entry may not be appropriate if you multicast. > # Support all icmp connections initiated from inside > # > pass in log first quick proto icmp all keep state This rule doesn't match the comment. You want to keep state on the "out" icmp packets and block the "in" icmp packets. However, you should be aware of the consequences of blocking too many ICMP packet types. ICMP is there for a reason. You can usually get away with blocking incoming redir, echo, and 13,15,17 ICMP types. You may want to allow the rest. > pass in quick proto udp from any to any port =3D 67 # dhcps > pass in quick proto udp from any to any port =3D 68 # dhcpc You want to allow incoming packets from your dhcp server's bootps port to your bootpc port. You probably don't want to allow everyone in the world to connect to your bootps and bootpc ports. > pass in quick proto udp from any to any port =3D 123 # ntp Not necessary if you are only using NTP and not creating a server. Just allow outgoing UDP with keep state. > pass in quick proto tcp from any to any port =3D 113 # ident You probably want to add something like "flags S/SFRA" to the end of incoming tcp pass rules. > # Allow all outgoing connections (SSH, TELNET, FTP, WWW, gopher, etc) > # > pass in log first quick proto tcp all flags S/SA keep state Here again your comment says "outgoing" but your rule applies to incoming. > # return RST packets for invalid SYN packets to help the other end close > block return-rst in log first proto tcp from any to any flags S/SA You just allowed all of these packets several lines before here so this rule will never be used. There are likely other problems but this should be enough to get you started. Basically you want to only use "pass in" for connections initiated on another machine to a service you provide. You then keep state on outgoing tcp/udp connections which handles return traffic to you. --=20 Note: See http://www.members.home.net/graywane/ for PGP information. --DocE+STaALJfprDB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjq+QBsACgkQeHdFaBWUGN3JPQCgqevtEqU14Fw6P2B1nZJwAjj9 ftkAoLpNdzlsc3dotME/mpHrZb7hYkvz =sK5b -----END PGP SIGNATURE----- --DocE+STaALJfprDB-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message