Forum Discussion
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