Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Nikolay S. Rybaloff" <nowhere@hakkenden.ath.cx>
To: "'G. Skillen'" <g@imagination.eu.org>, jason.faulkner@mailtrust.com
Cc: netfilter@vger.kernel.org
Subject: RE: NAT and openvpn
Date: Sat, 28 Mar 2009 12:24:51 +0300	[thread overview]
Message-ID: <000501c9af87$0f47cfa0$2dd76ee0$@ath.cx> (raw)
In-Reply-To: <20090328025132.56657521.g@imagination.eu.org>

http://iptables-tutorial.frozentux.net/iptables-tutorial.html

SNAT is only valid in POSTROUTING chain, DNAT - in PREROUTING. 

These rules should be:

iptables -t nat -A PREROUTING -d $PUBIP -j DNAT --to-destination $VPNIP		# for incoming traffic
iptables -t nat -A POSTROUTING -s $VPNIP -j SNAT --to-source $PUBIP			# for outgoing traffic

-----Original Message-----
From: netfilter-owner@vger.kernel.org [mailto:netfilter-owner@vger.kernel.org] On Behalf Of G. Skillen
Sent: Saturday, March 28, 2009 5:52 AM
To: jason.faulkner@mailtrust.com
Cc: netfilter@vger.kernel.org
Subject: Re: NAT and openvpn

> % iptables -t nat -A PREROUTING -s $VPNIP -j SNAT --to-source $PUBIP
> % iptables -t nat -A POSTROUTING -s $PUBIP -j DNAT --to-destination $VPNIP 

Thanks for the reply ... when I try that I get:

	mothership:~# iptables -t nat -A PREROUTING -s 10.8.0.2 -j SNAT --to-source <ip omitted>
	iptables: Invalid argument

(same for the next line)

Any ideas?

-- 
G. Skillen <g@imagination.eu.org>
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  parent reply	other threads:[~2009-03-28  9:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-27 21:14 NAT and openvpn G. Skillen
2009-03-28  2:39 ` jason.faulkner
2009-03-28  2:51   ` G. Skillen
2009-03-28  6:03     ` jason.faulkner
2009-03-28  8:22       ` Mart Frauenlob
2009-03-28  9:24     ` Nikolay S. Rybaloff [this message]
2009-03-28 14:49       ` G. Skillen
2009-03-28 11:04 ` G.W. Haywood
2009-03-28 14:51   ` G. Skillen

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='000501c9af87$0f47cfa0$2dd76ee0$@ath.cx' \
    --to=nowhere@hakkenden.ath.cx \
    --cc=g@imagination.eu.org \
    --cc=jason.faulkner@mailtrust.com \
    --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