[Exim] Using a DB of blocked IPs with both plain and ip/bits…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Karl Schmidt
Date:  
À: Exim \(E-mail\)
Sujet: [Exim] Using a DB of blocked IPs with both plain and ip/bits addresses
Take your txt file (called blocked_IPs.txt in this example) of IPs that you
want blocked that may look like this:
192.18.98.64/26
211.133.249.128/25
128.121.246.0/24
207.0.205.127
(Notice both plain and slash-bits notation)
The following command produces a database:
exim_dbmbuild blocked_IPs.txt blocked_IPs.dbm
Now place the following in your exim.conf file:
host_reject = net24-dbm;/etc/exim/blocked_IPs.dbm :\
net25-dbm;/etc/exim/blocked_IPs.dbm :\
net26-dbm;/etc/exim/blocked_IPs.dbm :\
net27-dbm;/etc/exim/blocked_IPs.dbm : \
net28-dbm;/etc/exim/blocked_IPs.dbm :\
net29-dbm;/etc/exim/blocked_IPs.dbm: \
net-dbm;/etc/exim/blocked_IPs.dbm
My tests indicate that the IP/bits notation MUST end on a valid subnet mask
boundary (see subnet masks for details of what numbers are valid.) In the
above example I have neglected doing any subnet larger than /24 or smaller
than /29, because if it is smaller than 29 it probably is better just to
list all the IPs, and it is not often necessary to anything larger than /24.


------------------------------------------------
Karl Schmidt (ks150)     EMail Karl@???
Transtronics, Inc.       WEB http://xtronics.com
3209 West 9th Street     Ph(785) 841-3089
Lawrence, KS 66049       FAX(785) 841-0434