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

RPM_201817's avatar
RPM_201817
Icon for Nimbostratus rankNimbostratus
Oct 09, 2015

Conditional HTTP/S Redirect - Source IP Range

My internal clients all fall within the private 10.0.0.0/8 IP address range. I'm looking for an iRule that will deliver all of the requirements listed below. The iRule will be attached to a single LTM virtual server that serves both internal and internet clients:

 

•Redirect all http to https

 

• 10.0.0.0/8 access to "https://portal.test.net/vcac" and "https://portal.test.net" should be permitted.

 

•Internet access to "https://portal.test.net/vcac" and "https://portal.test.net" should be redirected to "http://error.test.net/oops".

 

•Internet access to "https://portal.test.net/vcac/org/*" should be permitted i.e. any string/uri following the "/org/" is ok.

 

Can anyone help please?

 

Many thanks

 

R

 

1 Reply

  • This should be pretty close to your description:

    when HTTP_REQUEST {
        if { [IP::addr [IP::client_addr] equals 10.0.0.0/8] } {
             local clients - allow all access
            return
        } else {
             remote clients
            if { [string tolower [HTTP::uri]] starts_with "/vcac/org/" } {
                 permit
                return
            } else {
                 redirect
                HTTP::redirect "http://error.test.net/oops"
            }   
        }
    }