Forum Discussion
Mike_Maher
Dec 20, 2011Nimbostratus
So from an iRule perspective, I think something as simple this should work
when HTTP_REQUEST {
if {[whereis [IP::client_addr]] contains "US"} {
HTTP::class select webscraping_disable_class
} else {
HTTP::class select webscraping_enable_class
}
}
If you are just looking to white list one country and send everyone else to the other class. If you have list of countries you want to white list or black list though, you will want to create a data list first perhaps named Country_List and then reference that list like below.
when HTTP_REQUEST {
if {[whereis [IP::client_addr]] contains $::Country_List} {
HTTP::class select webscraping_disable_class
} else {
HTTP::class select webscraping_enable_class
}
}
Hope this helps.
Mike