Community discussions

MikroTik App
 
zimbofury
newbie
Topic Author
Posts: 48
Joined: Wed Nov 03, 2010 8:10 am

Linux mail server

Sat Jul 09, 2011 1:41 pm

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
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Linux mail server

Sat Jul 09, 2011 8:49 pm

RouterOS is Linux based, and the firewall is iptables based. Look at the wiki manual and you'll find things are pretty much equivalent.
Port Forwarding to LAN mail server - iptables -t nat -A PREROUTING -p tcp --dport 25 -s 0/0 -j DNAT --to <a href="tel:192.168.88.2">192.168.88.2</a>:25
Port Forwarding to LAN mail server - iptables -t nat -A PREROUTING -p tcp --dport 110 -s 0/0 -j DNAT --to <a href="tel:192.168.88.2">192.168.88.2</a>:25
For the Webmail - iptables -t nat -A PREROUTING -p tcp --dport 80 -s 0/0 -j DNAT --to <a href="tel:192.168.88.2">192.168.88.2</a>:80
/ip firewall nat
add chain=dstnat protocol=tcp dst-port=25,80,110 action=dst-nat to-address=192.168.88.2
 
zimbofury
newbie
Topic Author
Posts: 48
Joined: Wed Nov 03, 2010 8:10 am

Re: Linux mail server

Mon Jul 25, 2011 10:35 am

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.

Who is online

Users browsing this forum: jerryuser and 15 guests