From: Oliver Sperke <oliver@sperke.net>
To: netfilter@vger.kernel.org
Subject: How to redirect OUTPUT traffic to another port
Date: Thu, 03 May 2012 15:25:34 +0200 [thread overview]
Message-ID: <4FA2874E.4020807@sperke.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 797 bytes --]
Hi,
I googled for hours, but could not find an answer. I establish a ssh
tunnel on server 1. The traffic is marked on the OUTPUT chain with the
owner attribute and then redirected on ip route to server 2. Everything
works so far. But how do I redirect the outgoing traffic from port 80 to
port 3080r? As far as I understand I can use the the OUTPUT chain to
redirect the port but then nothing works anymore. It seems like the
traffic is just dropped. My idea was:
iptables -t mangle -A OUTPUT -m owner --uid-owner 2000 -j MARK
--set-mark 0x1
32765: from #serverip# fwmark 0x1 lookup #gateway#
This works so far, but this not:
iptables -t nat -A OUTPUT -s #serverip# -m owner --uid-owner 2000 -p tcp
--dport 80 -j REDIRECT --to-ports 3080
Can anybody help me?
Oliver
[-- Attachment #2: S/MIME Kryptografische Unterschrift --]
[-- Type: application/pkcs7-signature, Size: 3893 bytes --]
reply other threads:[~2012-05-03 13:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4FA2874E.4020807@sperke.net \
--to=oliver@sperke.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.