If traffic coming to a virtual server needs to be redirected to a different server, pool or URL by testing if the source IP belongs or does not belong to a list of network addresses, it can be achieved using LTM policy and datagroups.
1. Create datagroup with list of IP/ Network addresses with which the source IP of incoming requests need to be compared –
Go to iRules > Data Group List. Click on create. Give it an appropriate name and set the type to ‘address’.
Multiple addresses can be added at the bottom by filling the Address field and clicking on add as shown in the screenshot below:
2. Policy creation –
You can then create an LTM policy rule and set the match conditions as:
TCP | address | matches | in datagroup | <datagroup name> | at | request | time
NOTE: you can also replace matches with ‘does not match’ if you wan the rule to match all IPs that dont belong to the datagroup.
Then in the section below you can choose to forward or redirect the traffic to any location.
Leave A Comment?