Ever since I started working with RouterOS, I've wondered why is it necessary to specify the "out-interface" in the srcnat firewall rule?
Code: Select all
/ip firewall nat
add chain=srcnat out-interface=ether1 action=masquerade
add chain=srcnat out-interface=ether2 action=masquerade
add chain=srcnat out-interface=ether3 action=masquerade
Every example I see does it this way.
I've tested it both with and without in a multi-wan load balance situation and it didn't seem to make an difference.
My reasoning is this:
The packet is already in the srcnat table so we know it is going "out".
We already know what interface it is going out; the rule uses "out-interface" for matching,
not for providing information to the Action.
In a multi-wan setup, the action is the same is the same in all four rules: "action=masquerade". Nothing else is specified for Action so it is evidently able to extract whatever information it needs from the packet header itself.
Is there some reason we can't just use:
Code: Select all
/ip firewall nat add chain=srcnat action=masquerade
Thanks all.