All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Frédéric Gonzatti" <fred99@libertysurf.fr>
To: netfilter@lists.netfilter.org
Subject: How to Forward a port (DNAT) ?
Date: Sat, 10 Jul 2004 23:39:59 +0200	[thread overview]
Message-ID: <40F0622F.6090500@libertysurf.fr> (raw)

Hi all,

Actually I'm using a routeur which is forwarding some ports on my DMZ 
(25,110 etc...). My firewall just allow or some some ports to pass or not.
In few days my Firewall (iptables 1.2.9) which have actually a private 
IP (192.168.3.1) will have a public IP.
So my firewall will have to replace my routeur and to forward ports 25 
and 110 to my DMZ.
To test I've done this  (this configuration is not connected to the 
internet)

                      62.160.1.2 eth2 (WAN Firewall)
                                          |
192.168.2.151                - | 192.168.2.1 eth1(DMZ firewall)
    (with port 25 open)         |
                                           |
                                     172.16.2.1 (eth0) LAN Firewall
I've configured a computer with IP 62.160.1.3 (to simultate an internet 
connection).
I try to make a telnet 62.160.1.2 25 on this computer but it doesn't work.
If I make a telnet on the public IP of my firewall (port 25)  I must see 
the sendmail on my 192.168.2.151 server.

My iptables rules are :
##########################################"
iptables -F
iptables -X

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP

iptables -t filter -A INPUT -i lo -j ACCEPT
iptables -t filter -A OUTPUT -o lo -j ACCEPT

iptables -t nat -A PREROUTING -p tcp --dport 25 -i eth2 -j DNAT --to 
192.168.2.151:25

#################################################"

It's a very simple test. But unfortunately it doesn't work.

Thanks for your help

Frederic






             reply	other threads:[~2004-07-10 21:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-10 21:39 Frédéric Gonzatti [this message]
2004-07-10 21:54 ` How to Forward a port (DNAT) ? Antony Stone
2004-07-10 22:02   ` Frédéric Gonzatti

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=40F0622F.6090500@libertysurf.fr \
    --to=fred99@libertysurf.fr \
    --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 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.