All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: tcp packets on 25 port FORWARDING
@ 2004-03-12 10:03 peter.gehle
  2004-03-12 10:21 ` Antony Stone
  0 siblings, 1 reply; 5+ messages in thread
From: peter.gehle @ 2004-03-12 10:03 UTC (permalink / raw)
  To: netfilter

Try this:

LAN_IP=$(ifconfig eth1 | head -n 2 | tail -n 1 | cut -d: -f2 | cut -d" " -f 1)
ipatbles -t nat -A PREROUTING -i *EXT-NIC* -p tcp --dport 25 -j DNAT --to_destination *POSTFIX-IP*
iptables -t nat -A POSTROUTING -o *INT-NIC* -p tcp --dport 25 -j SNAT --to-source $LAN_IP
iptables -A FORWARD -i *EXT-NIC* -m state --state NEW -p tcp -d *POSTFIX-IP* --dport 25 -j ACCEPT

EXT-NIC = your external Network Interface (eth0, eth1...)
INT-NIC = your internal Network Interface (eth1, eth2...) where your Postfix Server is connected to
POSTFIX-IP = The IP of your Postfix Server

That should work.

Mit freundlichen Grufl / Best regards / Meilleures
salutation / Met vriendelijke groet

Peter Gehle
Systemberatung Gehle GmbH
Im Bahler Grund 5

D-49413 Dinklage
Germany

Phone : +49 4443 9796-12
Fax   : +49 4443 9796-29

www.sbgit.com


Original Message       processed by Tobit InfoCenter
Subject: tcp packets on 25 port FORWARDING (12-Mrz-2004 10:50)
From:    stanislav.puffler@seznam.cz
To:      peter.gehle@sbgit.com


Hi there,
I need to forward all tcp packets with port 25 (SMTP) from Internet to machine in my network. My settings (eth0 = internet IP, eth1 = 192.168.200.1 - dmz IP connected to another machine with Postfix, eth2 = 192.168.0.1 - gateway - LAN). Have opened port 25 and setup rule :

iptables -t nat -A PREROUTING -p tcp -dport 25 - i eth0 -j DNAT -to 192.168.200.2:85

iptables -A FORWARD -i eth0 -p tcp -d 192:168.200.2 -dport 25 -m state -state NEW,ESTABLISHED,RELATED -j ACCEPT

But it still doesn't route tcp packets on port 25 to my Postfix computer :o( If I try telnet 192.168.200.2 25 from FW it works, if I try this from Internet, it doesn't work :o( Any ideas ? Thanks a lot.
Stan.


To: stanislav.puffler@seznam.cz
Cc: netfilter@lists.netfilter.org



^ permalink raw reply	[flat|nested] 5+ messages in thread
* tcp packets on 25 port FORWARDING
@ 2004-03-12  9:46 Stanislav Puffler DiS.
  2004-03-12  9:57 ` Antony Stone
  0 siblings, 1 reply; 5+ messages in thread
From: Stanislav Puffler DiS. @ 2004-03-12  9:46 UTC (permalink / raw)
  To: netfilter

[-- Attachment #1: Type: text/plain, Size: 735 bytes --]

Hi there,

I need to forward all tcp packets with port 25 (SMTP) from Internet to
machine in my network. My settings (eth0 = internet IP, eth1 = 192.168.200.1
- dmz IP connected to another machine with Postfix, eth2 = 192.168.0.1 -
gateway - LAN). Have opened port 25 and setup rule :

 

iptables -t nat -A PREROUTING -p tcp -dport 25 - i eth0 -j DNAT -to
192.168.200.2:85

 

iptables -A FORWARD -i eth0 -p tcp -d 192:168.200.2 -dport 25 -m state
-state NEW,ESTABLISHED,RELATED -j ACCEPT

 

But it still doesn´t route tcp packets on port 25 to my Postfix computer :o(
If I try telnet 192.168.200.2 25 from FW it works, if I try this from
Internet, it doesn´t work :o( Any ideas ? Thanks a lot.

Stan.

 


[-- Attachment #2: Type: text/html, Size: 3064 bytes --]

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

end of thread, other threads:[~2004-03-12 10:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-12 10:03 tcp packets on 25 port FORWARDING peter.gehle
2004-03-12 10:21 ` Antony Stone
  -- strict thread matches above, loose matches on Subject: below --
2004-03-12  9:46 Stanislav Puffler DiS.
2004-03-12  9:57 ` Antony Stone
2004-03-12 10:47   ` Stanislav Puffler DiS.

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.