We need to create an iRule to allow access to a VIP from only a certain list of IP addresses. I can see how to do this by creating an iRule that references an IP Address Data Group. The problem lies in that we have a 20,000 user network and need to restrict the access to 600 individual IP addresses. We can do some summarization but we’re still looking at 500 entries into the Data Group.
Does anyone know if you can import a text file or copy and paste somehow into the IP Address Data Group to save entering 500 IP addresses?
You could either use an external class which requires you to create a file and paste it in there…otherwise, you could simply edit the config file and paste into there.
01070626:3: The IP data group external file (/config/filestore/.stage_d/502_d/Common_d/data_group_d/:Common:banned-ip-list.file_1) has an invalid format, line: 1.
Then I tried to load it from the command line and I get:
01070626:3: The IP data group external file (/config/filestore/.stage_d/502_d/Common_d/data_group_d/:Common:banned-ip-list.file_1) has an invalid format, line: 1.have you seen “Handling Line Terminator Discrepencies” section in the following article? can you try?
tmsh create /sys file data-group banned-ip-list.file separator ":=" source-path file:/var/class/banned-ip-list.dg type ip
01070626:3: The IP data group external file (/config/filestore/.stage_d/524_d/Common_d/data_group_d/:Common:banned-ip-list.file_1) has an invalid format, line: 1.
Reading over this may help: Writing iRules look in the sub-topic “Creating, managing, and using data groups”.
Location:An external data group must reside in either the /config or the /var/class directory. The default location for storing external data groups is the /config directory.
As far as your formatting issue I think you must specify what it is in the External Class. If it’s a host it automatically appends 255.255.255.255 in the background (you will only see this if you use iControl to pull the class members) and if it’s a network it appends the assigned netmask: