Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Mark Ord <netfilter-list@losthorizons.mailshell.com>
To: netfilter@lists.netfilter.org
Subject: iptables local port forwarding
Date: Sat, 3 Apr 2004 19:50:05 +1000	[thread overview]
Message-ID: <20040403095005.GA4511@scholars.home> (raw)

I'm sure the answer to this is out there somewhere on the internet,
however numberous searches since I installed Debian a couple of months
ago haven't provided the exact answer to what I want.

My setup is:

Debian woody
uname: Linux scholars 2.4.18-mppe #1 Sat Dec 20 13:42:14 EST 2003 i686 unknown
iptables: iptables v1.2.6a
eth0: 10.0.13.192 (-> internet)
eth1: 192.168.0.1 (-> lan)

I have iptables setup, firewalling eth0 (the internet) extensively, and
doing NAT for my lan, and some custom port forwards.

One is forwarding port 81 -> 80 - due to my provider firewalling port
80:
     iptables -t nat -I PREROUTING -p tcp --dport 81 -j REDIRECT --to 80

This works for connections coming in on both eth0, and eth1. However, I
can't connect to port 81 on the iptables machine (no matter what
iptables rules I try). On the lan side, I use a http proxy residing on
the iptables machine, hence can not connect to port 81 from the lan when
going through the proxy. It's not a huge problem (since I can and do use
port 80 from the lan side), I'm moreso just really interested in whether this
actually IS possible, and if not, why?

While making this work isn't critical, I would like to do some other
fancy forwarding which requires the same sort of thing. (ssh port
forwarding on the iptables machine, then forwarding ports on specific
nic interfaces to the ssh forwarded port on lo, to avoid having to bind ssh
forwarded ports with 'GatewayPorts yes'). Basically I'd like to know if
this crazy type of setup is acheivable.

TIA.
Mark.



             reply	other threads:[~2004-04-03  9:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-03  9:50 Mark Ord [this message]
2004-04-03 10:27 ` iptables local port forwarding Antony Stone
2004-04-03 17:30   ` Bill Davidsen
2004-04-03 23:09     ` Antony Stone
2004-04-04 11:03   ` Mark Ord
2004-04-05 17:44     ` Antony Stone

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=20040403095005.GA4511@scholars.home \
    --to=netfilter-list@losthorizons.mailshell.com \
    --cc=netfilter@lists.netfilter.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