I have a RB3011 with ROS7.5 running as an edge router. Behind it is a pfsense FW via a transit vlan (172.16.100.0/24), and behind that FW, a mail server on one of the PFsense's legs (mailserver=172.16.15.11). The Mikrotik does the NAT-ing between the internal 172.16.0.0/12 networks and the public internet. It looks like this (well, it looks fancier in real life):
(Internet)----Mikrotik-----Pfsense-----Mailserver
In order to be completely honest, I wanted to be completely transparent by telling you that there is indeed a Pfsense FW in between, but please don't point it to be the responsible device:
- this FW has been in place (with different upgrades of course) for 15+ years
- the mail server has been in place for 15+ years (also with upgrades of course)
- all that has changed now is the edge router as I am migrating from Cisco (+ WAN link behind it) to Mikrotik (+new WAN link behind it).
- the workaround I have put in place (see below) and packet captures (also see below) put the PFsense out of cause.
Now to my issue.
Oubound邮件工作完全从我们的服务器(the outside world). However, we are unable to receive mails from outside with simple DST-NAT (with the old cisco it worked flawlessly), that is what makes me wonder). I am pretty sure there is an additional FW rule that needs to be set on the MT, but I can't figure out which...
As a temp workaround, I had to implement DST-NATandSRC-NAT on the mikrotik. It works in terms of receiving emails, however, this is not a viable solution as the mail server sees all inbound mails coming from the MT's LAN IP, which means that the IP-based ACL's (for mitigating brute-force attacks) had to be deactivated and most spam filters are also useless now.
Here's what is currently in place:
Code:Select all
/ip firewall filter add action=accept chain=forward comment="INBOUND SMTP" dst-address=172.16.15.11 dst-port=25 in-interface=WAN_ISP protocol=tcp /ip firewall nat add action=dst-nat chain=dstnat comment=SMTP dst-address= dst-port=25 in-interface=WAN_ISP protocol=tcp to-addresses=172.16.15.11 to-ports=25 add action=src-nat chain=srcnat dst-address=172.16.15.11 dst-port=25 protocol=tcp to-addresses=172.16.100.2
172.16.100.2 is the Mikrotik IP on the transit VLAN to the Pfsense
Now, here are 2 packet captures on the FW (on the 172.16.100.0/24 transit VLAN from the MT), both times for an inbound mail coming from the internet:
- without the SRC-NAT rule ( I replaced the external's server IP with 1.1.1.1 as it is a client's server...):
Code:Select all
1.1.1.1.36610 > 172.16.15.11.25: tcp 0 172.16.15.11.25 > 1.1.1.1.36610: tcp 0 1.1.1.1.36610 > 172.16.15.11.25: tcp 0 172.16.15.11.25 > 11.1.1.1.36610: tcp 0 1.1.1.1.36610 > 172.16.15.11.25: tcp 0 1.1.1.1.36610 > 172.16.15.11.25: tcp 0 172.16.15.11.25 > 1.1.1.1.36610: tcp 0 1.1.1.1.36610 > 172.16.15.11.25: tcp 0 172.16.15.11.25 > 1.1.1.1.36610: tcp 0
Code:Select all
172.16 172.16.100.2.44218 > 172.16.15.11.25: tcp 0.15.11.25 > 172.16.100.2.44218: tcp 0 172.16.100.2.44218 > 172.16.15.11.25: tcp 0 172.16.15.11.25 > 172.16.100.2.44218: tcp 28 172.16.100.2.44218 > 172.16.15.11.25: tcp 0 172.16.100.2.44218 > 172.16.15.11.25: tcp 27 172.16.15.11.25 > 172.16.100.2.44218: tcp 73 172.16.100.2.44218 > 172.16.15.11.25: tcp 35 172.16.15.11.25 > 172.16.100.2.44218: tcp 8 172.16.100.2.44218 > 172.16.15.11.25: tcp 34 172.16.15.11.25 > 172.16.100.2.44218: tcp 8 172.16.100.2.44218 > 172.16.15.11.25: tcp 6 172.16.15.11.25 > 172.16.100.2.44218: tcp 15 172.16.100.2.44218 > 172.16.15.11.25: tcp 1440 172.16.100.2.44218 > 172.16.15.11.25: tcp 784 ....
谢谢!
Denis