F5 irule(判斷client IP可否進入pool並且redirect)

需要判斷來源IP是否可以進入pool,並redirect
 

when HTTP_REQUEST  {
    set ipaddr [IP::client_addr]
    set clientip [whereis $ipaddr country]
    if { 
         [class match  [IP::client_addr] equals "PH-OA-IP"]

   } {  if { ([HTTP::host] equals "abc.com")}{
    HTTP::redirect "https:www.google.com[HTTP::uri]"
  }
  
               log local0. " Allow IP  [IP::client_addr]"  
               ;#  This can be removed/commented out if not required
   }
       elseif { 
         [class match $clientip equals "blockedcountries"]
   } {
             HTTP::respond 403 content     [ifile get sorry_page]
               log local0. " Block Geo country [IP::client_addr]"  
               ;#  This can be removed/commented out if not required
   }
else {
log local0. "Allow Geo country [IP::client_addr]"  
       
   }
}