Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
To: "J. Webster" <webster_jack@hotmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: iptables not forwarding port 443
Date: Wed, 07 Jul 2010 16:51:04 +0200	[thread overview]
Message-ID: <4C349458.6010202@plouf.fr.eu.org> (raw)
In-Reply-To: <BAY145-w560F4D16A39DD1B39B1A1FF3B20@phx.gbl>

Hello,

J. Webster a écrit :
> I have an openvpn server running on port 1194 successfuly.
> The box is 1 server split into 2 IP addresses xx.xx.xx.198 and xx.xx.xx.199.
> A proxy server runs on the 198 server and the VPN on 199.
> I have been trying to set up a port forward from port 443 on the 199 server to 1194 so that users cn use the VPN when they are in hotels or behind work firewalls. Althought the packets are reaching the server, the VPN will not connect on port 443. 
> I have tried the OpenVPN mailing list and after extensive testing, they cannot see why the packets are not being received so something must be wrong with the routing.
> Any ideas on what the problem could be?
> I have included the iptables rules below.
> 
> # Generated by iptables-save v1.3.5 on Wed Jun 30 16:44:05 2010
> *filter
[...]
> -A INPUT -d xx.xxx.xxx.199 -p tcp -m tcp --dport 1194 -m state --state NEW -j ACCEPT
[...]
> *nat
[...]
> -A PREROUTING -d xx.xxx.xxx.199 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 1194

Just a thought : the iptables manpage says that REDIRECT changes the
destination address to the *primary* address of the incoming interface.
If the primary address is xx.xxx.xxx.198 while the openvpn server
listens on xx.xxx.xxx.199, I'm afraid it won't do what you expect. I'd
suggest to replace REDIRECT with DNAT and specify the new destination
address explicitly.

> -A PREROUTING -d xx.xxx.xxx.199 -p udp -m udp --dport 443 -j REDIRECT --to-ports 1194

(Why redirect UDP if you don't accept it ?)

  parent reply	other threads:[~2010-07-07 14:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-06 16:39 iptables not forwarding port 443 J. Webster
2010-07-06 17:05 ` Gáspár Lajos
2010-07-06 17:10   ` J. Webster
2010-07-06 17:26     ` Gáspár Lajos
2010-07-06 17:40       ` J. Webster
2010-07-06 18:03         ` Grant Taylor
2010-07-06 18:08         ` Gáspár Lajos
2010-07-06 18:23           ` J. Webster
2010-07-07  1:54           ` J. Webster
2010-07-07 14:51 ` Pascal Hambourg [this message]
2010-07-07 14:53   ` J. Webster
2010-07-07 15:00     ` Pascal Hambourg
2010-07-07 15:20       ` J. Webster
2010-07-07 15:50         ` Pascal Hambourg
2010-07-08 16:12           ` J. Webster
2010-07-08 17:34             ` Jan Engelhardt
2010-07-08 18:56             ` Pascal Hambourg

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=4C349458.6010202@plouf.fr.eu.org \
    --to=pascal.mail@plouf.fr.eu.org \
    --cc=netfilter@vger.kernel.org \
    --cc=webster_jack@hotmail.com \
    /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