netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* SYNPROXY *NAT/redirects etc.
@ 2015-06-22 13:32 Christian Ruppert
  2015-06-23 21:33 ` Pascal Hambourg
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Ruppert @ 2015-06-22 13:32 UTC (permalink / raw)
  To: netfilter

Hi,

I noticed that neither *NAT nor redirects will work when using the 
SYNPROXY module with e.g. those settings:
net.netfilter.nf_conntrack_tcp_loose=0
sysctl -w net.ipv4.tcp_syncookies=1
sysctl -w net.netfilter.nf_conntrack_tcp_loose=0
sysctl -w net.ipv4.tcp_timestamps=1

iptables -t raw -I PREROUTING -p tcp -m tcp --syn -j CT --notrack
iptables -I INPUT -p tcp -m tcp -m conntrack --ctstate INVALID,UNTRACKED 
-j SYNPROXY --sack-perm --timestamp --wscale 7 --mss 1460
iptables -A INPUT -m conntrack --ctstate INVALID -j DROP

So when doing a redirect for example, the SYNPROXY will open the 
connection to the original destination address and port but it will not 
go through the rest of the iptables rules and thus the redirect/NAT has 
no effect at all. DNAT might be somewhat different though, I wasn't able 
to figure out to where it tries to establish the connection.
If you disable the SYNPROXY it will work as expected.

I saw that a NF_ACCEPT will be used in the module and I assume that's 
why it does not further through the rules. I'm not sure if XT_CONTINUE 
(like in the handshake part) would be possible here or work at all. Or 
is there any other workaround to get this working? Or am I using it 
wrong? Is that by design?

-- 
Regards,
Christian Ruppert
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in

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

end of thread, other threads:[~2015-07-28 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-22 13:32 SYNPROXY *NAT/redirects etc Christian Ruppert
2015-06-23 21:33 ` Pascal Hambourg
2015-06-24 18:07   ` Christian Ruppert
2015-06-24 21:57     ` Pascal Hambourg
2015-07-28 15:34       ` Christian Ruppert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).