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 08-22-2013, 02:36 AM   #1
Domtoren
LQ Newbie
 
Registered: May 2013
Location: Utrecht, the Netherlands
Distribution: Debian
Posts: 3

Rep: Reputation: Disabled
block ip range


Is this going to work:

iptables -I INPUT -m iprange --src-range 1.160.0.0-1.175.255.255 -j DROP

Will this block, say, ip-address 1.163.4.5?

Thanks in advance
 
Old 08-22-2013, 08:09 AM   #2
Linux MR
Member
 
Registered: May 2013
Location: Pacific North West
Distribution: Red Hat, Scientific, Fedora, openSuSE, Mageia, Mint, Arch
Posts: 57

Rep: Reputation: Disabled
The syntax looks correct.
Have you seen this past thread: http://www.linuxquestions.org/questi...tables-469432/

You should set it up and try using telnet or netcat to test it.
Quote:
telnet -b <source-ip>
ncat -s <source_ip>
Hope that helps...
 
Old 08-22-2013, 08:20 AM   #3
Domtoren
LQ Newbie
 
Registered: May 2013
Location: Utrecht, the Netherlands
Distribution: Debian
Posts: 3

Original Poster
Rep: Reputation: Disabled
iptables accepts the syntax. And the Tauwanese spammers/hackers that were bothering me haven't been around since I added this line.

But testing with netcat or telnet: No joy...

netcat -s 1.163.4.5 localhost 25
Can't grab 1.163.4.5:0 with bind : Cannot assign requested address
 
Old 08-22-2013, 03:45 PM   #4
Linux MR
Member
 
Registered: May 2013
Location: Pacific North West
Distribution: Red Hat, Scientific, Fedora, openSuSE, Mageia, Mint, Arch
Posts: 57

Rep: Reputation: Disabled
try binding the ip to an interface and adding a route.
***BUT FIRST DON'T FORGET TO SAVE A COPY OF THE ORIGINAL, AND REPLACE THE NEWER CONFIGS***

for example...
eth0 IP: 192.168.1.1
IP to spoof: 7.7.7.7
Target IP: 5.5.5.5

Code:
ifconfig eth0 7.7.7.7
route add -net 7.7.7.0 eth0
nc -nvu -s 7.7.7.7 -g 192.168.1.1 5.5.5.5 1111
Hope that helps...
 
  


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
block whole IP range with iptables jonfa Linux - Security 6 11-19-2008 07:37 AM
block webcams/torrent/etc for a range of IPs rogerdv Linux - Networking 1 11-15-2008 12:56 AM
Proftpd block IP range C-Sniper Linux - Security 9 02-01-2008 07:20 PM
i want to block a range of ips using iptables... Vasili Linux - Security 18 09-19-2006 06:31 AM
how to block an entire IP range? enzo250gto Linux - Networking 2 05-01-2004 08:59 AM

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

All times are GMT -5. The time now is 05:41 PM.

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