From: "Suganthi K" <sukandas@cisco.com>
To: netfilter@vger.kernel.org
Subject: iptable - string matching - from to offset values
Date: Tue, 22 Dec 2009 12:30:29 +0530 [thread overview]
Message-ID: <002301ca82d4$73c79de0$5b56d9a0$@com> (raw)
Hi,
I have a packet with the octets 32,33 having the values 0x21 and 0x12
respectively.
I am trying to filter out the packets using iptables rule
"iptables -t raw -A INPUT -m string --algo bm --from 31 --to 32 --hex-string
'|21 12|' -j LOG"
This rule filters the packet and I could find it in the logs.
starting with the first octet of the packet at offset 0, the required
pattern "21 12" appears at offset 32 and 33 of the packet.
rule "iptables -t raw -A INPUT -m string --algo bm --from 32 --to 33
--hex-string '|21 12|' -j LOG" fails to filter the packet.
Please let me know if anybody has faced a similar situation before.
Any help on the --from and --to values for string pattern matching will be
appreciated.
Thanks & Regards,
Suganthi
reply other threads:[~2009-12-22 7:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='002301ca82d4$73c79de0$5b56d9a0$@com' \
--to=sukandas@cisco.com \
--cc=netfilter@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).