Forum Discussion

enlowb_27270's avatar
enlowb_27270
Icon for Nimbostratus rankNimbostratus
Mar 19, 2009

Irule conversion help needed

I have an irule from version 4.x that I need help converting to 9.x.

 

 

Version 4.x irule below:

 

 

if (client_addr == 172.27.16.0 netmask 255.255.255.0) {

 

use pool PS_Portal

 

}

 

else { redirect to "https://%h/%u"}

 

 

So I need a rule that says if you are in the 172.27.16.0/24 network use pool PS_Poortal otherwise convert http to https with same host same uri. Thanks in advance for the help...

2 Replies

  • I think this is what you are looking for

     
     when HTTP_REQUEST { 
     if { [IP::addr [IP::client_addr]/24 equals 172.27.16.0 ] } { 
     pool PS_Portal 
     } else { 
     HTTP::redirect "https://[HTTP::host][HTTP::uri]" 
     } 
     } 
     

    hope this helps

    CB