LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Forward SMTP to another server (SuSE with iptables) (https://www.linuxquestions.org/questions/linux-security-4/forward-smtp-to-another-server-suse-with-iptables-412501/)

baetmaen 02-07-2006 02:43 AM

Forward SMTP to another server (SuSE with iptables)
 
Hi,

in the moment, I'm moving my root server to a new one. During this action, I want to loose not too much mails :D

I want to forward incoming connections on the old server to the new server. This should be possible, or am I wrong ?

I'm not very familiar with iptables. My firewall script was written by a friend of me. I only understand a little bit and I did try forwarding some time ago, without success. Here is the rule, that allows incoming SMTP connections on the old server.
What has to be changed to forward these connections to lets say IP 10.10.10.10 ?

Code:

iptables -A INPUT -i eth0 -m state --state NEW -p tcp --dport 25 -j ACCEPT
Thanks a lot :D
Joerg

baetmaen 02-07-2006 05:14 AM

Problem solved !

I configured rinetd to forward everything from the old to the new Server :D

Cya
Joerg

win32sux 02-11-2006 02:05 PM

Quote:

Originally Posted by baetmaen
What has to be changed to forward these connections to lets say IP 10.10.10.10 ?

Code:

iptables -A INPUT -i eth0 -m state --state NEW -p tcp --dport 25 -j ACCEPT

well, even though you already worked this out, here's more or less the iptables commands you would have had to use, in case it might be helpful to someone:

Code:

iptables -t nat -A PREROUTING -p TCP -i eth0 --dport 25 -j DNAT \
--to-destination 10.10.10.10

iptables -A FORWARD -p TCP -i eth0 -d 10.10.10.10 --dport 25 j ACCEPT



All times are GMT -5. The time now is 06:19 PM.