Nat prefrence

HI Guys,

Rookie question.

I have 2 WAN links coming into my Mikrotik.

Both are DHCP Clients which i NAT my local LAN Through.

My question is can i nat a whole subnet through 1 link but NAT one of the static IP’s within the LAN to go through the second link.

At the moment the NAT rule seems to put preference to the link in ether 1 regardless if it is at the top or not.
Only way i seem to be able to kick it to the second NAT rule is to disable ether 1 so it fails to ether 2.

Any ideas would be great thanks

Remember that the NAT rule isn’t going to determine which interface the Mikrotik uses to send the packet. The only thing the NAT table does is make changes to the source/destination IP and port numbers.

Basically, to do what you want, the NAT rule should be very simple: if going out wan1, nat source to wan1-address, if going out wan2, nat source to wan2-address. That’s all you need to do with NAT.

If you want LAN > wan1, but HostX > wan2, then you do it with policy.

Use the mangle table to put routing mark on packets from HostX.
Create routes in routing table with routing mark for HostX.

Packets from HostX will follow the routes with the same routing mark before they follow the “main” routing table.

Thanks for your reply.

Had a feeling someone was going to tell me to do it with mangle rules.

Still haven’t completely got my head around them :frowning:

Thanks!