Linux Netfilter discussions
 help / color / mirror / Atom feed
* simple nat question
@ 2002-07-02 19:34 Ben
  2002-07-02 19:55 ` Antony Stone
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Ben @ 2002-07-02 19:34 UTC (permalink / raw)
  To: NetFilter

I've got a basic nat setup:

  internet
     |
+====+=====+ eth0: 1.2.3.4
| firewall |
+====+=====+ eth1: 10.0.0.1
     |
+====+=====+ eth0: 10.0.0.2
|  server  |
+==========+


What I would like is for packets coming from the server (10.0.0.2) to get
SNAT'd to the firewall's IP address, 1.2.3.4. It seems easy enough to do:

iptables -t nat -A POSTROUTING -o eth0 -s 10.0.0.2 -j SNAT --to 1.2.3.4

But now I don't see how return packets are going to make it back to my
server, because the firewall is going to think they are destined for it.
If I add the rule:

iptables -t nat -A PREROUTING -d 1.2.3.4 -i ! eth0 -j DNAT --to 10.0.0.2

Then it seems I loose the ability for the firewall to run anything
accessable to the outside world, like ssh.



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2002-07-03  7:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-02 19:34 simple nat question Ben
2002-07-02 19:55 ` Antony Stone
2002-07-02 20:13   ` Jan Humme
2002-07-02 20:18     ` Antony Stone
2002-07-02 20:47       ` Jan Humme
2002-07-02 20:51         ` Ben
2002-07-02 20:58           ` Antony Stone
2002-07-02 21:08             ` Jan Humme
2002-07-02 20:53         ` Antony Stone
2002-07-02 20:37   ` Ben
2002-07-02 20:18 ` Aldo S. Lagana
2002-07-03  7:00 ` Raymond Leach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox