Forum Discussion
Add address in bulk to address list in AFM
Hi
I need a script to add addresses in an existing address list on AFM using the modify /security firewall address-list White_List addresses add . Can any one help me ?>
- draco_184361Nimbostratus
will the below work ?
while read p do tmsh modify /security firewall address-list White_List addresses add { $p } done < address_list.txt
- dragonflymrCirrostratus
Hi,
Works like a charm! One question, how to pass different Address List (instead of fixed White_List) name as argument?
Piotr
- Leonardo_SouzaCirrocumulus
Just improving your script...
!/bin/bash while read p do tmsh modify /security firewall address-list $1 add { $p } done < $2 ./script_name "White_List" "address_list.txt"
- W_Getty_299688Nimbostratus
This doesn't work for me. I get an issue with bash placing the curly braces on the next line. I had take a different approach.
I put the following in the IP list file for each IP you want in the list:
modify security firewall address-list WhiteList addresses add {x.x.x.x}
Then I ran the following:
tmsh < whitelist.txt
BIG-IP v13.1.0
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com