Community discussions

MikroTik App
 
User avatar
machack
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Fri Jun 01, 2007 9:35 pm
Location: San Luis Argentina
Contact:

Rename Address-List

Wed Nov 19, 2014 2:24 am

If posible, rename an addresslist? :shock:
 
changeip
Forum Guru
Forum Guru
Posts: 3829
Joined: Fri May 28, 2004 5:22 pm

Re: Rename Address-List

Wed Nov 19, 2014 5:09 am

pseudo code:
/ip firewall address-list set [find [name=original]] name=newname
 
Ansy
Frequent Visitor
Frequent Visitor
Posts: 72
Joined: Mon Oct 17, 2011 1:32 pm
Location: Russia
Contact:

Re: Rename Address-List

Fri May 17, 2019 11:30 am

How about simply swap address-list (as ipset swap in Linux iptables)?
 
mikruser
Long time Member
Long time Member
Posts: 578
Joined: Wed Jan 16, 2013 6:28 pm

Re: Rename Address-List

Wed Jul 22, 2020 3:04 pm

changeip
your code do not work.

Also have this question - how to rename address list via Winbox?
 
sindy
Forum Guru
Forum Guru
Posts: 10205
Joined: Mon Dec 04, 2017 9:19 pm

Re: Rename Address-List

Wed Jul 22, 2020 3:47 pm

@changeip's code works if you replace both occurrences of name by list.

how to rename address list via Winbox?
No way to do that in a single step from Winbox except running the code suggested by @changeip in the [Terminal] window. The address list items are separate rows in a common table, where the address list name is just a single column of these rows. So the change has to be done on each individual row, and Winbox doesn't have an option to do this.

Don't forget that changing the list name for all the respective rows in the /ip firewall address-list table will not change references to the old name of the list in firewall rules and scripts.
 
hatred
just joined
Posts: 21
Joined: Tue Sep 01, 2015 10:23 pm
Location: Belarus, Minsk

Re: Rename Address-List

Sun May 30, 2021 4:29 am

For me that works: /ip firewall address-list set list="new-name" [find list="old-name"]

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 71 guests