Page 1 of 1

Remove src-address via script...

Posted: Mon Aug 26, 2019 11:03 pm
by CZFan
I have client devices that have their LAN address range as src-address, want to run a script that will remove / disable the src-address field and set the out interface as WAN interface list.

I tired the following, but it tells me it needs an address range, which sounds logical, but how do I then remove / disable this field? I am sure I read something about it couple of days ago, but cant find it.
/ip firewall nat set [find where action="masquerade"] src-address="" out-interface-list=WAN

Re: Remove src-address via script...  [SOLVED]

Posted: Tue Aug 27, 2019 1:36 am
by sebastia
/ip firewall nat set [find where action="masquerade"] !src-address out-interface-list=WAN

Re: Remove src-address via script...

Posted: Tue Aug 27, 2019 1:52 am
by SiB
You should write "I have some SNAT for few separated LAN and must change it fast way"...
I must go to MikroTik firewall to check what is your real problem.

This is very easy to resolv itself. Just pressing TAB few times and do negative with !parameter. Remember that differ stuff is parameter!=value then !parameter.
Your code who change ALL masq to disable, without src-address and you should have at least ONE main SNAT rule to your ISP.
/ip firewall nat set [find action=masquerade] !src-address out-interface-list=WAN disabled=yes