Community discussions

 
User avatar
CZFan
Forum Guru
Forum Guru
Topic Author
Posts: 1396
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Randburg
Contact:

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
MTCNA, MTCTCE, MTCRE & MTCINE
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1777
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
SiB
Member Candidate
Member Candidate
Posts: 171
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 | WebChat: Tokonda
WinBox Tip: F6 works as ALT+TAB | Gliffy.com - free network schematic | prnt.sc - free ScreenShot software

Who is online

Users browsing this forum: No registered users and 2 guests