LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 07-10-2013, 02:14 PM   #1
karthik-naren
LQ Newbie
 
Registered: Jun 2013
Posts: 16

Rep: Reputation: 0
question about iptables on blocking a ping packet based on size


how to block particular size ping packets using iptables in linux?

For example :-

block 1000 to 5000 size ping packet?

Last edited by karthik-naren; 07-10-2013 at 02:16 PM.
 
Old 07-10-2013, 02:26 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,403

Rep: Reputation: Disabled
Have you tried the length match criteria?

Untested:
Code:
iptables -t filter -A INPUT -p icmp --icmp-type 8 -m length --length 1000:5000 -j DROP
Edit: The length match includes the header. If you want to match the size of the ICMP payload, you'll have to add 28 bytes for the header.

Last edited by Ser Olmy; 07-10-2013 at 02:30 PM.
 
1 members found this post helpful.
Old 07-12-2013, 07:34 AM   #3
karthik-naren
LQ Newbie
 
Registered: Jun 2013
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Ser Olmy View Post
Have you tried the length match criteria?

Untested:
Code:
iptables -t filter -A INPUT -p icmp --icmp-type 8 -m length --length 1000:5000 -j DROP
Edit: The length match includes the header. If you want to match the size of the ICMP payload, you'll have to add 28 bytes for the header.




Thanks!
 
  


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
Lipipq(iptables) . How do I redirect captured packet to another address with iptables inet905 Programming 0 05-25-2010 02:20 AM
Blocking UDP packet sailwind Linux - Software 3 04-08-2009 05:07 AM
Question about port blocking with Iptables GUIPenguin Linux - Networking 2 10-11-2004 07:25 PM
Blocking non-ip packet Half_Elf Linux - Security 14 05-20-2003 05:25 AM
iptables PREROUTING and blocking question bakuretsu Linux - Security 3 09-12-2002 11:49 AM


All times are GMT -5. The time now is 06:01 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration