Community discussions

MikroTik App
User avatar
Forum Guru
Forum Guru
Topic Author
Posts: 1784
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Randburg

Remove src-address via script...

Mon Aug 26, 2019 11:03 pm

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
User avatar
Forum Guru
Forum Guru
Posts: 1797
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

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

Tue Aug 27, 2019 1:36 am

/ip firewall nat set [find where action="masquerade"] !src-address out-interface-list=WAN
User avatar
Forum Veteran
Forum Veteran
Posts: 974
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: Remove src-address via script...

Tue Aug 27, 2019 1:52 am

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
MTCNA + MTCRE + MTCINE | ~600 users at ~150 RouterBoards in EMEA | Telegram: @SiB_PL
WinBox Tip: F6 works as ALT+TAB | - free network schematic | - free ScreenShot software
I will be at MUMEUROPE Prague on ?? ?? 202?

Who is online

Users browsing this forum: No registered users and 93 guests