Hi pedinopa@gmail.com,
the best approach would be to use a LTM datagroup to store the different IP Addresses / Subnets and to use the
[class]
command to lookup those IPs within an iRule and then trigger the redirect. If you need to add additional IPs then you don't need to change your iRule. Just add a new entry into the data-group using the WebInterface.
Data Group:
ltm data-group internal DG_REDIRECT_IPs {
records {
1.1.1.1/32 { }
2.2.2.2/32 { }
3.3.3.3/32 { }
10.0.0.0/8 { }
172.16.0.0/12 { }
192.168.0.0/16 { }
}
type ip
}
iRule:
when HTTP_REQUEST {
if { [class match [getfield [IP::client_addr] "%" 1] equals DG_REDIRECT_IPs]] } then {
HTTP::redirect "http://SERVER/index.htm"
}
}
For further information you may take a look to the
[class]
command wiki page.
https://devcentral.f5.com/wiki/iRules.class.ashx
Cheers, Kai