LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-26-2009, 12:03 AM   #1
satya_seth
LQ Newbie
 
Registered: May 2009
Posts: 11

Rep: Reputation: 0
How to drop packets


Hi

I want to drop some packets based on their sequence number, which are coming to my system.

Can anybody suggest, how to do so?

Regards
Satyabrata
 
Old 05-26-2009, 09:52 AM   #2
contusion
Member
 
Registered: Mar 2005
Posts: 310

Rep: Reputation: 35
iptables software does that
man iptables
 
Old 06-18-2009, 10:56 AM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
Or http://iptables-tutorial.frozentux.n...-tutorial.html
 
Old 06-18-2009, 02:14 PM   #4
zomane
Member
 
Registered: Sep 2005
Location: Bulgaria
Distribution: Debian, CentOS
Posts: 44

Rep: Reputation: 16
This is simple example how to drop tcp packets based on flags, this flag combination described bellow will never been send from "normal" (web browser, ftp client, etc. )software, they can be send from portscanner or something similar.

Creating new chain
iptables -N dropp
Setting rules in chain
iptables -A dropp -p tcp --tcp-flags ALL FIN,URG,PSH -j badflags
iptables -A dropp -p tcp --tcp-flags ALL ALL -j badflags
iptables -A dropp -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j badflags
iptables -A dropp -p tcp --tcp-flags ALL NONE -j badflags
iptables -A dropp -p tcp --tcp-flags SYN,RST SYN,RST -j badflags
iptables -A dropp -p tcp --tcp-flags SYN,FIN SYN,FIN -j badflags

Logging&Drop

iptables -N badflags
iptables -A badflags -m limit --limit 15/minute -j LOG --log-prefix Badflags:
iptables -A badflags -j DROP
But to understand how to wrote your own rules you must read man iptables carefully .
Iptables is very powerful tool and thats why the beginning is a little hard.
 
Old 07-06-2009, 04:15 AM   #5
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally Posted by satya_seth View Post
I want to drop some packets based on their sequence number, which are coming to my system.

Can anybody suggest, how to do so?
Iptables can do this with the u32 module.

There's a HOWTO for this here (jump to the section called Moving on to the TCP header).
 
Old 07-06-2009, 04:30 AM   #6
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 174
Blog Entries: 3

Rep: Reputation: 38
go for Iptables it works for u.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Capture, drop packets using C pumpkin Linux - Networking 12 03-14-2012 04:36 AM
Sudden drop of TX packets which unables me to browse Choucete Linux - Networking 1 09-18-2008 12:47 PM
drop packets for specific port with iptables ohcarol Linux - Security 1 07-03-2005 10:48 AM
How to intentionally drop packets? imarunner Linux - Networking 5 12-31-2003 08:10 AM
why does the kernel drop packets ? mr.moto Linux - Networking 3 12-08-2002 12:47 AM


All times are GMT -5. The time now is 07:40 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration