Community discussions

MikroTik App
 
tomislav91
Member
Member
Topic Author
Posts: 303
Joined: Fri May 26, 2017 12:47 pm

remove from NAT where have named address list

Tue May 18, 2021 10:51 pm

I am having a strugle with removing some rules from NAT, where i have rules with some named address list inside rule, like
add action=dst-nat chain=dstnat dst-address-list=MyList protocol=tcp \
to-addresses=1.2.3.4 to-ports=4444
I want to use script to remove all rules which have dst-addresss MyList..Cant figure out how to pick that address list, so i can write a command for deleting those rules in NAT

i tried like this
                                                                                       
 :local NAT4Remove [/ip firewall nat get number=[find where dst-address-list=MyList]]  

but i get
no such file
Idea is when i have numbers, just to use with ip firewall nat remove numbers=$NAT4Remove
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: remove from NAT where have named address list

Tue May 18, 2021 11:15 pm

                                                                                       
 :local NAT4Remove [/ip firewall nat get number=[find where dst-address-list=MyList]]  

??? why that ???

simply:
/ip firewall nat remove [find where dst-address-list="MyList"]
 
tomislav91
Member
Member
Topic Author
Posts: 303
Joined: Fri May 26, 2017 12:47 pm

Re: remove from NAT where have named address list

Wed May 19, 2021 11:37 pm

                                                                                       
 :local NAT4Remove [/ip firewall nat get number=[find where dst-address-list=MyList]]  

??? why that ???

simply:
/ip firewall nat remove [find where dst-address-list="MyList"]


i was driving in another directions. Thanks, thats it

Who is online

Users browsing this forum: No registered users and 17 guests