I'm doing some testing of an application I am working on, and I need to be able to silently drop outgoing UDP packets for a short period of time to replicate a possible failure mode.
Is there any way to do this?
DROP is not silent for outgoing messages! When a
send() or similar call is dropped by
iptables, it returns
EPERM for some bizarre reason (see here. Unfortunately, I can't use that answer as my destination is a single hop away).
xtables-addons used to have a
STEAL verb, but it got removed a few years ago for no reason I can find.
I've now tried using bogus routes in the routing table, and unfortunately, that appears to break both directions of comm traffic.
For the test I need to do, I have to allow inbound UDP traffic, and as soon as I install the bogus route, the streaming incoming packets immediately halt, though the source is still sending them.