* Is there a way to DROP on OUTPUT without returning EPERM?
@ 2008-01-10 21:36 Mike Kasick
2008-01-10 22:26 ` G.W. Haywood
2008-01-11 8:51 ` Benny Amorsen
0 siblings, 2 replies; 3+ messages in thread
From: Mike Kasick @ 2008-01-10 21:36 UTC (permalink / raw)
To: netfilter
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!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Is there a way to DROP on OUTPUT without returning EPERM?
2008-01-10 21:36 Is there a way to DROP on OUTPUT without returning EPERM? Mike Kasick
@ 2008-01-10 22:26 ` G.W. Haywood
2008-01-11 8:51 ` Benny Amorsen
1 sibling, 0 replies; 3+ messages in thread
From: G.W. Haywood @ 2008-01-10 22:26 UTC (permalink / raw)
To: netfilter
Hi there,
On Thu, 10 Jan 2008, Mike Kasick wrote:
> iptables -A OUTPUT -o eth1 -m statistic --mode random --probability 0.5 -j DROP
>
> has the side effect of returning EPERM ... 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?
Instead of DROPping it, why not just send it somewhere else?
--
73,
Ged.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Is there a way to DROP on OUTPUT without returning EPERM?
2008-01-10 21:36 Is there a way to DROP on OUTPUT without returning EPERM? Mike Kasick
2008-01-10 22:26 ` G.W. Haywood
@ 2008-01-11 8:51 ` Benny Amorsen
1 sibling, 0 replies; 3+ messages in thread
From: Benny Amorsen @ 2008-01-11 8:51 UTC (permalink / raw)
To: netfilter
Mike Kasick <mkasick-nf@club.cc.cmu.edu> writes:
> 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.
It would make more sense if DROP dropped silently and REJECT returned
EPERM. Hard to fix now, of course.
/Benny
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-11 8:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-10 21:36 Is there a way to DROP on OUTPUT without returning EPERM? Mike Kasick
2008-01-10 22:26 ` G.W. Haywood
2008-01-11 8:51 ` Benny Amorsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox