All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nagy Zoltan <nagy.zoltan@cit.hu>
To: monty denis <montydenis@yahoo.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: How to filter this packet?
Date: Mon, 23 Apr 2007 18:22:25 +0200	[thread overview]
Message-ID: <462CDD41.8020505@cit.hu> (raw)
In-Reply-To: <450608.64360.qm@web63507.mail.re1.yahoo.com>

monty denis wrote:
> Hello, all.
> 
> I can filter some protocol packet like below.
> 
> iptables -A INPUT -p x 
> 
> But how can I filtre like (proto 0) below?
> proto 0 means protocol 0 ?
> 
> I can find protocol 0 information at  
> http://www.iana.org/assignments/protocol-numbers
> 
> 
>  11.34.254.146 -> xx.xx.xx.xx [proto 0]
>   ........WinSock 2.0.....LG@.

hi
you can use: l7,string,u32
string is the simplest and cheapest for this,
but if you place a rule like:
$ipt -m string --from 8 --to 16 --string WinSock
you maybe have to face with false positives.

or you can create a chain and return for all legal protocols, in this 
way you can provide a negate for the others, and kick out proto 0 (and 
others as well)
or you can go ahead and implement handling of protocol 255 it's reserved 
anyway ;)
that way netfilter can use proto 255 for marking any protocol is ok
and use 0 and others as protocol identifiers

eg:

table INPUT
ipt -j PROTONEG

table PROTONEG
ipt -p tcp -j RETURN
ipt -p udp -j RETURN
ipt -p icmp -j RETURN
ipt -j DROP


good luck ;)
kirk


  reply	other threads:[~2007-04-23 16:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-20  9:36 How to filter this packet? monty denis
2007-04-20  9:36 ` monty denis
2007-04-23 16:22   ` Nagy Zoltan [this message]
2007-04-23 18:23     ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=462CDD41.8020505@cit.hu \
    --to=nagy.zoltan@cit.hu \
    --cc=montydenis@yahoo.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.