Routing email traffic on Mikrotik


I have two internet providers connected to my router: 1st ISP 192.168.1.0/24; 2nd ISP 192.168.2.0/24. And I need to re-route all email traffic via 2nd ISP. So, let’s do that:

/ip firewall mangle
add chain=prerouting action=mark-routing new-routing-mark="POP3 traffic" passthrough=no protocol=tcp dst-port=110
add chain=prerouting action=mark-routing new-routing-mark="IMAP traffic" passthrough=no protocol=tcp dst-port=143
add chain=prerouting action=mark-routing new-routing-mark="SMTP traffic" passthrough=no protocol=tcp dst-port=25

/ ip route
add dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=255 target-scope=10 routing-mark="POP3 traffic"
add dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=255 target-scope=10 routing-mark="IMAP traffic"
add dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=255 target-scope=10 routing-mark="SMTP traffic"

Leave a Reply

Your email address will not be published. Required fields are marked *