Forum Discussion

Nd27_312475's avatar
Nd27_312475
Icon for Nimbostratus rankNimbostratus
Mar 03, 2017

iRule to not redirect from certain source addresses

Hi All,

 

I apply a very simple iRule to a VIP to redirect all traffic to a maintenance splash page. However i need to add the option for certain source IPs to function normally.

 

At present the iRule shows

 

when HTTP_REQUEST { HTTP::redirect }

 

How do i get it to allow certain specific hosts to function normally?

 

1 Reply

  • Something like this:

    when HTTP_REQUEST {
        if { !( [IP::addr [IP::client_addr] equals 10.1.0.0/25] ) } {
            HTTP::redirect http://x/x/maintenance.html
        }
    }
    

    You can make it even better by using a datagroup.