LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-02-2004, 08:32 AM   #1
kemplej
Member
 
Registered: Dec 2003
Posts: 235

Rep: Reputation: 30
Blocking A Class of Ips w/ Iptables


I want to block a group of ips on my email server using iptables. Would the best way be to block say 192.168.1.0?
 
Old 09-02-2004, 08:53 AM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
What range do you want to block:
192.168.1.0 - ?
 
Old 09-02-2004, 04:25 PM   #3
kemplej
Member
 
Registered: Dec 2003
Posts: 235

Original Poster
Rep: Reputation: 30
192.168.1.* was just an example. My email servers just seem to get slammed by virii senders daily from the same ISP and I was just hopeing to block them out since they seem to be on a dialup modem.


Justyn
 
Old 09-02-2004, 09:03 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
The specific IP didn't matter, I was just trying to get an idea of how big a block you want to drop traffic from. Anyway, the general rule for blocking traffic:

For a single host (192.168.2.1):
iptables -I INPUT -s 192.168.2.1 -j DROP

For a range (192.168.2.0 - 192.168.2.255):
iptables -I INPUT -s 192.168.2.1/24 -j DROP

For a range (192.168.0.0 - 192.168.255.255):
iptables -I INPUT -s 192.168.0.0/16 -j DROP
 
Old 09-03-2004, 11:02 AM   #5
kemplej
Member
 
Registered: Dec 2003
Posts: 235

Original Poster
Rep: Reputation: 30
Cool thank you
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Blocking certain IPs with iptables - what am I doing wrong? thinksincode Linux - Security 2 12-21-2004 10:27 AM
how to define a specific range of IPs and/or multiple IPs in an iptables rule?... TheHellsMaster Linux - Security 9 09-20-2004 10:06 AM
Blocking IPs bluelaguna Linux - Security 2 05-28-2004 02:08 PM
Troubles blocking single IPs using IPtables dave_blob Linux - Networking 5 04-04-2004 06:07 AM
Blocking IPS clanehleader Linux - Security 2 09-01-2003 10:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration