From owner-freebsd-questions@freebsd.org Tue Feb 18 16:08:55 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E442D23EA9F for ; Tue, 18 Feb 2020 16:08:55 +0000 (UTC) (envelope-from starikarp@dismail.de) Received: from mx1.dismail.de (mx1.dismail.de [78.46.223.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.dismail.de", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48MQlB4JHfz3P9G for ; Tue, 18 Feb 2020 16:08:53 +0000 (UTC) (envelope-from starikarp@dismail.de) Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id b966e6f3 for ; Tue, 18 Feb 2020 17:08:51 +0100 (CET) Received: from smtp1.dismail.de ( [10.240.26.11]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 08afae2c for ; Tue, 18 Feb 2020 17:08:51 +0100 (CET) Received: from smtp1.dismail.de (localhost [127.0.0.1]) by smtp1.dismail.de (OpenSMTPD) with ESMTP id a67047d4 for ; Tue, 18 Feb 2020 17:08:51 +0100 (CET) Received: by dismail.de (OpenSMTPD) with ESMTPSA id c0b50458 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Tue, 18 Feb 2020 17:08:50 +0100 (CET) Date: Tue, 18 Feb 2020 11:08:47 -0500 From: ajtiM To: freebsd-questions@freebsd.org Subject: Re: Blacklist IP file for IPFW? Message-ID: <20200218110847.57d10344@dismail.de> In-Reply-To: References: <9585fce4-b48d-a210-d62f-a2100c0cf929@tundraware.com> <24139.58932.915276.752500@jerusalem.litteratus.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd12.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 48MQlB4JHfz3P9G X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.86 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[dismail.de:s=20190914]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[dismail.de.dwl.dnswl.org : 127.0.5.2]; R_SPF_ALLOW(-0.20)[+ip4:78.46.223.134]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[134.223.46.78.list.dnswl.org : 127.0.5.2]; DKIM_TRACE(0.00)[dismail.de:+]; DMARC_POLICY_ALLOW(-0.50)[dismail.de,reject]; IP_SCORE(-2.16)[ip: (-9.91), ipnet: 78.46.0.0/15(0.69), asn: 24940(-1.55), country: DE(-0.02)]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:78.46.0.0/15, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2020 16:08:56 -0000 On Tue, 18 Feb 2020 17:00:25 +0300 I am starting with: ipfw table 1 create cat /etc/bogons | xargs -n1 ipfw table 1 add ipfw table 2 create cat /etc/mine | xargs -n1 ipfw table 2 add .... .... and than I have $cmd 00600 deny ip from 'table(1)' to any $cmd 00650 deny log ip from 'table(2)' to any I did use script before: #!/bin/csh ipfw table 1 create fetch -o /tmp/drop.txt http://www.spamhaus.org/drop/drop.txt sed -i '' "s/;.*//" /tmp/drop.txt ipfw table 1 flush foreach IP ( `cat /tmp/drop.txt` ) ipfw table 1 add $IP end and I have in ipf.rules: # Get ip's from Spamhaus # /etc/tables.sh -- "The only difference between a beggar and a Duke was the amount of money they possess". George Orwell