netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Ruppert <idl0r@qasl.de>
To: netfilter@vger.kernel.org
Subject: SYNPROXY *NAT/redirects etc.
Date: Mon, 22 Jun 2015 15:32:06 +0200	[thread overview]
Message-ID: <e662686ca44f5edf617a50d78fa4444d@qasl.de> (raw)

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

             reply	other threads:[~2015-06-22 13:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22 13:32 Christian Ruppert [this message]
2015-06-23 21:33 ` SYNPROXY *NAT/redirects etc Pascal Hambourg
2015-06-24 18:07   ` Christian Ruppert
2015-06-24 21:57     ` Pascal Hambourg
2015-07-28 15:34       ` Christian Ruppert

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=e662686ca44f5edf617a50d78fa4444d@qasl.de \
    --to=idl0r@qasl.de \
    --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;
as well as URLs for NNTP newsgroup(s).