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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-26-2009, 12:03 AM
|
#1
|
|
LQ Newbie
Registered: May 2009
Posts: 11
Rep:
|
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
|
|
|
|
05-26-2009, 09:52 AM
|
#2
|
|
Member
Registered: Mar 2005
Posts: 310
Rep:
|
iptables software does that
man iptables
|
|
|
|
06-18-2009, 10:56 AM
|
#3
|
|
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
|
|
|
|
|
06-18-2009, 02:14 PM
|
#4
|
|
Member
Registered: Sep 2005
Location: Bulgaria
Distribution: Slackware, Debian
Posts: 42
Rep:
|
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.
|
|
|
|
07-06-2009, 04:15 AM
|
#5
|
|
Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
Quote:
Originally Posted by satya_seth
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).
|
|
|
|
07-06-2009, 04:30 AM
|
#6
|
|
Member
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 174
Rep:
|
go for Iptables it works for u.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:46 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|