Community discussions

MikroTik App
 
IntraLink
Member Candidate
Member Candidate
Topic Author
Posts: 113
Joined: Fri May 28, 2004 5:44 pm
Location: Utah Valley
Contact:

Need script/command to find IP in NAT rule and delete rule

Wed May 17, 2006 9:21 pm

I'm sure this is easier than it looks, but what is the command/script that will find an IP in the NAT rules and delete the rule?

Say I have a dst-nat rule for 10.20.20.24 set up and I want to delete that rule by searching for that IP, how is that done?
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Wed May 17, 2006 10:44 pm

/ip firewall nat remove [/ip firewall nat find dst-address=10.20.20.24]

Be careful not to delete all your nat rules by 'finding' everything.

Sam
 
IntraLink
Member Candidate
Member Candidate
Topic Author
Posts: 113
Joined: Fri May 28, 2004 5:44 pm
Location: Utah Valley
Contact:

Thu May 18, 2006 12:52 am

Cool, that is what I was looking for, thanks!
 
User avatar
NetworkPro
Forum Guru
Forum Guru
Posts: 1376
Joined: Mon Jan 05, 2009 6:23 pm
Location: bit.ly/the-qos
Contact:

Re:

Mon Jan 31, 2011 11:25 pm

/ip firewall nat remove [/ip firewall nat find dst-address=10.20.20.24]

Be careful not to delete all your nat rules by 'finding' everything.

Sam
I use this to remove DYNAMIC NAT rules put there by UPnP.

The new syntax in v5 seems to include " " around the attribute:
/ip firewall nat remove [/ip firewall nat find dst-address="10.20.20.24"]

Thank you.

Who is online

Users browsing this forum: ohilton576 and 3 guests