Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Mike Kasick <mkasick-nf@club.cc.cmu.edu>
To: netfilter@vger.kernel.org
Subject: Is there a way to DROP on OUTPUT without returning EPERM?
Date: Thu, 10 Jan 2008 16:36:05 -0500	[thread overview]
Message-ID: <20080110213605.GA14931@club.cc.cmu.edu> (raw)

I'm trying to emulate network packet loss by randomly dropping packets with
netfilter and the statistic match module.  Everything works fine with the
following firewall rule:

iptables -A INPUT -i eth1 -m statistic --mode random --probability 0.5 -j DROP

However, since packets are dropped by the receiving machine, they're still
making it out on the wire.  I also want to test dropping packets on the
sending machine such that they never make it to the wire, unfortunately the
analogous rule:

iptables -A OUTPUT -o eth1 -m statistic --mode random --probability 0.5 -j DROP

has the side effect of returning EPERM for write/send syscalls for which
packets are dropped.  While this behavior makes sense in the usual case,
I'd really like to drop packets silently without the user application being
notified.

Is there a way I can achieve a truly silent DROP on the OUTPUT chain?  Is
there an extension target that does this that I've missed?

Thanks!

             reply	other threads:[~2008-01-10 21:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-10 21:36 Mike Kasick [this message]
2008-01-10 22:26 ` Is there a way to DROP on OUTPUT without returning EPERM? G.W. Haywood
2008-01-11  8:51 ` Benny Amorsen

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=20080110213605.GA14931@club.cc.cmu.edu \
    --to=mkasick-nf@club.cc.cmu.edu \
    --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