[linux] Re: grote blocklist in dns server zetten

Kees Theunissen theuniss op rijnh.nl
Do Jun 2 14:08:16 CEST 2005


On Thu, 2 Jun 2005, Johan Wevers wrote:

>>#!/bin/bash
>>for ip in `cat iprange.txt` ; do
>>  /path/to/iptables -A OUTPUT -d $ip -j REJECT --reject-with tcp-reset
>>Done
>
>Da's natuurlijk wel mooi ja. Alleen die cat zal iets lastiger worden vrees
>ik: die tabel ziet er zo uit:
>
>Fake File Servers AP2P:0.0.0.1-3.255.255.255
>S0 0.ciscoseattle.bbnplanet.net:4.0.25.146-4.0.25.148
>P1 0.cisco.bbnplanet.net:4.0.26.14-4.0.29.24
>Werner Media:4.2.160.64-4.2.160.79
>
>[ hele grote knip ]
>
>Het stuk voor die : is natuurlijk wel weg te werken, maar hoe verwerk ik die
>IP ranges?



Zie de iptables(8) manpage onder het kopje "MATCH EXTENSIONS".


   iprange
       This matches on a given arbitrary range of IPv4 addresses

       [!]--src-range ip-ip
              Match source IP in the specified range.

       [!]--dst-range ip-ip
              Match destination IP in the specified range.


Groeten,

Kees.

-- 
Kees Theunissen
F.O.M.-Instituut voor Plasmafysica "Rijnhuizen", Nieuwegein
E-mail: theuniss op rijnh.nl,     Tel: 030-6096724,     Fax: 030-6031204



More information about the Linux mailing list