View previous topic :: View next topic |
Author |
Message |
haimat Apprentice
Joined: 05 Sep 2002 Posts: 239 Location: Vienna / Austria
|
Posted: Tue Apr 27, 2004 10:53 pm Post subject: Problem with iptables and port-forwarding (DNAT) |
|
|
Hi all,
I have a strange problem with my netfiler setup. First to my infrastructure: I have a firewall/gateway in front of a private network, there is a mail server. The firewall is connected to the internet via a ppp line.
Now I want to forward all incoming traffic on port 25 (SMTP) to my intern mail server. So I added the following command to my firewall script:
Code: | $IPTABLES -t nat -A PREROUTING -i $E_NIC -p tcp --dport 25 -j DNAT --to-destination 192.168.120.10:25 |
(I know this should work, because I have exactly the same line on other setups.)
But when I now want to test this, I get the following:
Code: | [ 00:30 haim@itchy ~ ] telnet <pub.IP> 25
Trying <pub.IP>...
Connected to <pub.IP>.
Escape character is '^]'.
Connection closed by foreign host. |
As you all can see, my connection gets dropped as soon as it was established. When I disable the above iptables line, I get the following response from telnet:
Code: | [ 00:19 haim@itchy ~ ] telnet <pub.IP> 25
Trying <pub.IP>...
telnet: Unable to connect to remote host: Connection refused |
(which is ok of course.)
Strange thing here is: When I do this port forwarding with the rinetd daemon, I get no errors and can connect to my mailserver fine.
So I think it's an iptables issue. Could this be because of the ppp line? Or what else is the problem here?
Greetings and TIA, Matthias |
|
Back to top |
|
|
haimat Apprentice
Joined: 05 Sep 2002 Posts: 239 Location: Vienna / Austria
|
Posted: Tue Apr 27, 2004 11:01 pm Post subject: |
|
|
UPDATE: I forgot to tell you, that the mail server is an MS Exchange server. It seems it is dropping my telnet connection.
When I try to forward port 80 (HTTP) to an intern IIS server, then I get no errors and can do a "GET" request.
Hmm... damn Microsoft
Anyway, some ideas?
Greetings, Matthias |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|