From owner-freebsd-questions@freebsd.org Mon Feb 17 15:27:46 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 48D0C23C1C8 for ; Mon, 17 Feb 2020 15:27:46 +0000 (UTC) (envelope-from hamdi20193d@gmail.com) Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Lnt917g0z4Xf4 for ; Mon, 17 Feb 2020 15:27:45 +0000 (UTC) (envelope-from hamdi20193d@gmail.com) Received: by mail-ua1-x92e.google.com with SMTP id a33so6261192uad.11 for ; Mon, 17 Feb 2020 07:27:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lqMTb5PP0Yfo5WdyCoZxfxZuLyKPzcUOPtEioSpR2DU=; b=iBZ2myJqnfhzn5BqjtszSqHcnocet/O9Ho2x6w3ye67s2kmFD6VFBMuo5m7QfwI83I 6CECBgl0Xh6Zm/B6P4xUDLXRKCLFlPzHhuMq+Eb90MZo/9IhGnuGkK2xuu3LsSTq6UCL 7xUleULS0p4aFNaOCFcFWw5MwARl9tGM2yebQv4kbA08tR3ILOP9yFg/bnbZ7q+q0zMC oReT64h8hnv6yKtx8o1buBVhiF9v+PhJc/scxcICUI4fVk6ls7uwCNn6VZVoctkhQh40 HLfRvAV7jm3Oia0WInrpBW1m/A6Xw8vetFXvIUzML8gsExxzHwWqjyn0dVnjJAVGpxDr QjFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lqMTb5PP0Yfo5WdyCoZxfxZuLyKPzcUOPtEioSpR2DU=; b=SKlNeIZXduTMN4xX4YqGVCpN6cq11oaHYxrx7yB5irRDLQEP3YUEPBeizs6S38XBrq jrKfvQZ1hvc3UwyWOr3jc49f/KwdQTTYDxiiPC5eQSb5us5qXMnnd/E6u2Gwr5VNXMY9 hzOlIbu29BqGI+vt1iMPncd0rRaWq2Y3JakXnJxQ7A3WDJmBuJSfJndI+C9HzyBjyVW2 cYBXlr/fEXvTYJTvJK++pPU5y1N4WnMwF+vTFO7Fs6NTfSwF8jkqPDC0/N5uVtaJ/qYD 7K6CxRLOxam1SYrlTMUUDKs6+qHWDxM5dbD0lL9+Cg+XXYKf7TZg6t252CmcNj2fTIuM aY1g== X-Gm-Message-State: APjAAAU3X2nJ5AuDJCH9X783/N6o8d7rEEUusNNOmSshY+YWDeTSVKeS 0AuQdOHu7f6j3XnqwoxmmSrnSTI881v34TlZPeKh6Q== X-Google-Smtp-Source: APXvYqyUZop8EzC4n0ulj69PbPtd4TBXXU30dsip/Ec9Szg6C5K4zFR8sWUzkqkzcTkH1dpeSjxoMNZomrQq07DPzrY= X-Received: by 2002:a9f:2635:: with SMTP id 50mr8271320uag.2.1581953264010; Mon, 17 Feb 2020 07:27:44 -0800 (PST) MIME-Version: 1.0 References: <9585fce4-b48d-a210-d62f-a2100c0cf929@tundraware.com> In-Reply-To: <9585fce4-b48d-a210-d62f-a2100c0cf929@tundraware.com> From: Andreas X Date: Mon, 17 Feb 2020 18:27:32 +0300 Message-ID: Subject: Re: Blacklist IP file for IPFW? To: Tim Daneliuk Cc: FreeBSD Mailing List X-Rspamd-Queue-Id: 48Lnt917g0z4Xf4 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=iBZ2myJq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of hamdi20193d@gmail.com designates 2607:f8b0:4864:20::92e as permitted sender) smtp.mailfrom=hamdi20193d@gmail.com X-Spamd-Result: default: False [0.00 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; URI_COUNT_ODD(1.00)[9]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-9.26), ipnet: 2607:f8b0::/32(-1.89), asn: 15169(-1.68), country: US(-0.05)]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[e.2.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; HTTP_TO_IP(1.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Mon, 17 Feb 2020 15:27:46 -0000 Great answer! Thank you so much, Tim! That's what I wanted to do. Last question: Would /etc/rc.local be the best choice to run these (at startup)? Or you'd perhaps have an another startup file, as suggestion.. Thank you once again, Tim Daneliuk , 17 =C5=9Eub 2020 Pzt, 17:51 tarihinde= =C5=9Funu yazd=C4=B1: > On 2/17/20 8:36 AM, Andreas X wrote: > > > > The list dramatically grows each week. How may I create a text file so > that > > IPFW would fetch these IPs from there directly? What's the simplest way > to > > do this please? > > > Looping through a file and running an ipfw command each time gets super > slow as > the list gets long. ipfw tables are the better way to do this: > > FWCMD=3D"ipfw -q" # Firewall command > OIF=3Dem0 # NIC to outside world > > # Address spaces we want blocked entirely are listed in this file > NAUGHTYFILE=3D/usr/local/etc/firewall/naughtyIPs > > # Use ipfw tables for efficiency > > ipfw table 10 flush > for addr in `cat ${NAUGHTYFILE}` > do > ${FWCMD} table 10 add ${addr} > done > > ${FWCMD} add deny all from table\(10\) to any via ${OIF} > > The "naughty" file can have specific IPs or CIDR blocks in it, one > per line: > > 95.87.0.0/18 > 95.87.192.0/18 > 96.246.220.34 > 96.30.64.0/18 > 98.143.148.107 > > > > > HTH, > > -------------------------------------------------------------------------= --- > Tim Daneliuk tundra@tundraware.com > PGP Key: http://www.tundraware.com/PGP/ > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" >