Forum Discussion
Aasis_162538
Jun 29, 2017Nimbostratus
Add 200 IP to the datagroup list
I came across the scenario where I need to add 200 specific IPs to the datagroup list. Rather than adding it manually, is there a way i can do it via cli? Can you please post the complete command/scr...
JG
Jun 30, 2017Cumulonimbus
Put all your addresses in a file:
cat /tmp/address_list
1.1.1.1
2.2.2.2
3.3.3.3
4.4.4.4
5.5.5.5
Run the following script (an example):
!/bin/sh
Uncomment the following line if your data group does not yet exist.
tmsh create ltm data-group internal test_dg type ip records add { 9.9.9.9 }
for i in `cat /tmp/address_list`
do
tmsh modify ltm data-group internal test_dg records add { $i }
done
tmsh list ltm data-group internal test_dg
If you see the following output:
ltm data-group internal test_dg {
records {
1.1.1.1/32 { }
2.2.2.2/32 { }
3.3.3.3/32 { }
4.4.4.4/32 { }
5.5.5.5/32 { }
9.9.9.9/32 { }
}
type ip
}
save the configuration as follows:
tmsh save /sys config
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects