Forum Discussion

stetson_308325's avatar
stetson_308325
Icon for Nimbostratus rankNimbostratus
Feb 16, 2017

iRule to Allow certain IP Addresses through, otherwise give maintenance content

I need to make an iRule that can allow through a couple of ip addresses to a virtual server. Otherwise, I would like to display a maintenance page. Here is what I have so far, I'm very new and I know the syntax and form isn't correct but this might be the right track:

when HTTP_REQUEST { if {( [IP::addr [IP::client_addr] equals 1.1.1.1] )} {pool Our-HTTP-Pool}

HTTP::respond 200 content \
 "Maintenance page
  All your servers are belong to us" "Content-Type" "text/html" 
          return
}

1 Reply

  • when HTTP_REQUEST { 
      if {( [IP::addr [IP::client_addr] equals 1.1.1.1] )} {
        pool Our-HTTP-Pool
      } else {
        HTTP::respond 200 content \
        "Maintenance page
         All your servers are belong to us" "Content-Type" "text/html" 
          return
      }
    }