For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

shafiul's avatar
shafiul
Icon for Nimbostratus rankNimbostratus
Jun 23, 2016

iRule help

We need to configure iRule datagroup with a list of domains referenced by iRule that would allow web access (port 80 if it does matter) based on this list. If the host header does not match list, access should not be permitted.

 

My assumption is like below, please correct if anything is missing. Thanks.

 

when HTTP_REQUEST { if {class match [string tolower [HTTP::header "User-Agent"] contains ]} pool else none }

 

1 Reply

  • Hi,

    The datagroup name is missing and you are getting the User-Agent instead of the Host header, and a couple of syntax issues. Below a valid example. You need to have a string based datagroup named "MY_DATAGROUP_NAME" :

    when HTTP_REQUEST { 
        if { [class match [string tolower [HTTP::header "Host"] equals MY_DATAGROUP_NAME] } {
            pool mypoolname
        } else {
              you can use drop, reject or HTTP::respond command
            reject 
        }