From owner-freebsd-questions@FreeBSD.ORG Mon Oct 11 10:09:16 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 2045516A4CE for ; Mon, 11 Oct 2004 10:09:16 +0000 (GMT) Received: from auk1.snu.ac.kr (auk1.snu.ac.kr [147.46.100.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0DA743D46 for ; Mon, 11 Oct 2004 10:09:15 +0000 (GMT) (envelope-from spamrefuse@yahoo.com) Received: from [147.46.44.181] (spamrefuse@yahoo.com) by auk1.snu.ac.kr (Terrace Internet Messaging Server) with ESMTP id 2004101119:01:41:507002.15513.2724826032 for ; Mon, 11 Oct 2004 19:01:41 +0900 (KST) Message-ID: <416A5BCA.3020708@yahoo.com> Date: Mon, 11 Oct 2004 19:09:14 +0900 From: Rob User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20041002 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pelle@spd.nu, freebsd-questions@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-TERRACE-SPAMMARK: YES-__TRSYS_LV__3 (SR:-3.50) (SRN:SPAMROBOT) ----------------- Subject: Re: Adding network & IP to hosts.deny X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2004 10:09:16 -0000 Pelle Andersson wrote: > Hi! > > I have a lot of login attempts from various networks and IP addresses > on my FBSD 4.10 server. I have read the man pages for hosts.deny but > do not understand how to add networks and IP addresses to it. > > Let's say I want to block the network address 192.168.100.0 and/or > the IP address 192.168.135.77. As far as I understood, the use of /etc/hosts.deny is (going to be?) depreciated. Instead use deny rules in /etc/hosts.allow. For example: ALL : 192.168.100.0 192.168.135.77 : deny This does: for all services that actually using the /etc/hosts.allow, it will deny all access by these two IP numbers. However, notice that there are services that do not use the hosts.allow, and those won't be affected. So if you want a full proof block of these IP numbers, you better make a firewall rule to deny their access. Rob.