dany
September 4, 2013, 11:11am
1
I’m trying to make a script which would allow me to remove an address from Address Lists.
As one needs the number of the address entry to be able to remove the address, I thought
of using something like this (lets say 192.168.205.13 is the address I want removed):
:put ([:pick [/ip firewall address-list print terse where address=192.168.205.13] 1 2])
I thought with the above command I would get the addresses entry number and then I would
use:
/ip firewall address-list remove <obtained_number>
But whatever I do I can not get just the number of the entry but I get the whole line instead, ie:
1 D list=Drop_List address=192.168.205.13
Could someone more experienced suggest a solution?
Thank you!
efaden
September 4, 2013, 12:03pm
2
dany:
I’m trying to make a script which would allow me to remove an address from Address Lists.
As one needs the number of the address entry to be able to remove the address, I thought
of using something like this (lets say 192.168.205.13 is the address I want removed):
:put ([:pick [/ip firewall address-list print terse where address=192.168.205.13] 1 2])
I thought with the above command I would get the addresses entry number and then I would
use:
/ip firewall address-list remove <obtained_number>
But whatever I do I can not get just the number of the entry but I get the whole line instead, ie:
1 D list=Drop_List address=192.168.205.13
Could someone more experienced suggest a solution?
Thank you!
/ip firewall address-list {
remove [find address=192.168.205.13]
}
dany
September 4, 2013, 12:21pm
3
So simple when you know what to do!
Thank you very much!!