Linux mail server

Hello. I have been having some problems with getting my routing correct. What is needed is all traffic on port 25 and 110 forwarded to the mail server that is on the lan. Also if someone leaves the lan and uses an alt internet connection, they should be able to reach the webmail server and normal sending and receiving should occur.

i know in linux the code is:

Port Forwarding to LAN mail server - iptables -t nat -A PREROUTING -p tcp --dport 25 -s 0/0 -j DNAT --to 192.168.88.2:25
Port Forwarding to LAN mail server - iptables -t nat -A PREROUTING -p tcp --dport 110 -s 0/0 -j DNAT --to 192.168.88.2:25

192.168.88.2 being the mail server.

For the Webmail - iptables -t nat -A PREROUTING -p tcp --dport 80 -s 0/0 -j DNAT --to 192.168.88.2:80

RouterOS is Linux based, and the firewall is iptables based. Look at the wiki manual and you’ll find things are pretty much equivalent.



/ip firewall nat
add chain=dstnat protocol=tcp dst-port=25,80,110 action=dst-nat to-address=192.168.88.2

thanks this worked well. just a problem with people who have accounts with domains that are not stored on the local linux server. ill just try add accept rules for those b4 the forward rule.