From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael K" Subject: RE: How to block a range of IPs? Date: Sun, 27 Apr 2003 09:25:01 +0200 Sender: netfilter-admin@lists.netfilter.org Message-ID: <000101c30c8e$1d885870$0200a8c0@klintan.local> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="us-ascii" To: 'Afshin Lamei' , netfilter@lists.netfilter.org > -----Original Message----- > From: netfilter-admin@lists.netfilter.org > [mailto:netfilter-admin@lists.netfilter.org] On Behalf Of Afshin Lamei > Sent: Sunday, April 27, 2003 8:12 AM > To: netfilter@lists.netfilter.org > Subject: How to block a range of IPs? > > > Hi, > How can I write a rule for a custom range of IPs? for > example, I want to > block every WWW packet incoming from eth1, which source is an > IP between > 192.168.1.10 and 192.168.1.20. > please help me writing an example. > thank you > afshin > > You can't, but if you subnet, the closest will be 192.168.1.1 to 192.168.0.14 using mask 255.255.255.240. Or 192.168.1.1 to 192.168.0.30 using mask 255.255.255.224. Example: iptables -A INPUT -i eth0 -p tcp -s 192.168.1.0/255.255.255.240 --dport www -j DROP /Klintan