All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Rash <mbr@cipherdyne.org>
To: netfilter-devel@lists.netfilter.org
Subject: Re: iptables match rule for DNS RR?
Date: Thu, 05 Apr 2007 20:17:59 -0400	[thread overview]
Message-ID: <20070406001759.GA4379@minastirith> (raw)
In-Reply-To: <20070405135234.GA27429@kallisti.us>

On Apr 05, 2007, Ross Vandegrift wrote:

> On Wed, Apr 04, 2007 at 10:49:01PM +0200, Patrick McHardy wrote:
> > Ross Vandegrift wrote:
> > > What does it mean for netlink to say "no such file or directory"?
> > 
> > 
> > The queue entry you're sending a verdict for does not exist.
> 
> Aha, thanks for the tip, that does make perfect sense.  Turns out I
> had a packet parser bug fouling things up.
> 
> Thanks again - I'm really amazed at how easy it was to extend
> netfilter to do what I needed in a pinch.  I'm now processing about
> 10k packets per second across a cluster of 15 servers, cutting their
> CPU load by 30-50%.  I'm quite thrilled!

You could also potentially use the string match extension to drop
offending packets from within the kernel (you mentioned odd query types,
so this is what you would match on).  For example, for ISDN queries you
could do:

iptables -I FORWARD 1 -p udp --dport 53 -d <dns_server> -m string
--hex-string "|00 00 14 00 01|" --from 46 --algo bm -j DROP

The --from value of 46 is somewhat arbitrary, but it gets past the MAC,
IP [1], and UDP headers, with 4 bytes to spare for a query that contains
at least something like \x03com.

[1] Assuming no IP options

--
Michael Rash
http://www.cipherdyne.org/
Key fingerprint = 53EA 13EA 472E 3771 894F  AC69 95D8 5D6B A742 839F

  reply	other threads:[~2007-04-06  0:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-04 13:18 iptables match rule for DNS RR? Ross Vandegrift
2007-04-04 13:49 ` Samuel Jean
2007-04-04 13:56   ` Ross Vandegrift
2007-04-04 20:12     ` Jan Engelhardt
2007-04-04 20:39       ` Ross Vandegrift
2007-04-04 20:49         ` Patrick McHardy
2007-04-05 13:52           ` Ross Vandegrift
2007-04-06  0:17             ` Michael Rash [this message]
2007-04-04 14:20 ` Patrick McHardy

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=20070406001759.GA4379@minastirith \
    --to=mbr@cipherdyne.org \
    --cc=netfilter-devel@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.