Linux Netfilter discussions
 help / color / mirror / Atom feed
* iptables as landmine subnet rejector
@ 2013-11-07 23:14 Jim Mellander
  2013-11-13 17:58 ` Jim Mellander
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Mellander @ 2013-11-07 23:14 UTC (permalink / raw)
  To: netfilter

Hi all:

I'm working on replacing a freebsd box with custom C code with a linux box.

The code has a configured pcap filter, and does the following with
traffic that matches the pcap filter.  BTW, the pcap filter is not
complex, basically 'tcp and (net a.b.c.d/xx or net e.f.g.h/xx)', so
the equivalent should be easily mappable to iptables rules.

1. If TCP sends RST back as response (obviously not RST in response to RST)
2. Responds to pings, ICMP echo response sent in response to icmp echo request.

I starting porting the code, but it occurred to me that perhaps the
entire job could be done in iptables using DNAT

1. Nat the tcp connection and issue a -j REJECT, or redirect to a
closed port on the the responder host, which will send a RST.
2. NAT the icmp echo request

With a bit of experimentation, I'm fairly certain I could work this
out, but some pointer to get me in the right direction would be
appreciated.

Thanks in advance.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-19 19:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07 23:14 iptables as landmine subnet rejector Jim Mellander
2013-11-13 17:58 ` Jim Mellander
2013-11-13 22:17   ` Phil Oester
2013-11-14 17:12     ` Jim Mellander
2013-11-19 16:23       ` Phil Oester
2013-11-19 19:33         ` Jim Mellander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox