Forum Discussion

Chenco_322726's avatar
Chenco_322726
Icon for Nimbostratus rankNimbostratus
Jun 13, 2017
Solved

restrict website to only specific ip addresses on same VS

Hello Friends , I have many domains on the same VS . and i am trying to restrict the access to to only specific ip addresses the problem is i found some irules on google but the problem is that i ha...
  • Morten_Marstra1's avatar
    Jun 13, 2017

    You could create a data group with the allowed ip addresses, and then reference them in an iRule, that only matches if the host header is :

    when HTTP_REQUEST {
        if { [HTTP::host] equals "www.example.com" } {
    
            Require client ip address to be present in datagroup (dg_example.com) for allowed source ip's
            if { ! [class match [IP::client_addr] eq dg_example.com] } {
                drop
                return
            }
        }
    
    }