Forum Discussion

radpat_360084's avatar
radpat_360084
Icon for Nimbostratus rankNimbostratus
Apr 30, 2018

iRule for internal and external traffic

want to send internal client to an internal website and send all other traffic to a customer website. Also Intercept an HTTP 404 message from a pool member and send the client an HTTP redirect instead

 

1 Reply

  • in this sample iRule your internal subnet is assumed 10.0.0.0/8.

    when HTTP_REQUEST {
    if { [IP::addr [IP::client_addr]/8 equals 10.0.0.0] }
    {
    pool internal_pool
    } else {
    pool external_pool
    }
    }
    when HTTP_RESPONSE {
      if { [HTTP::status] == 404 } {
        HTTP::redirect "http://www.anothersite.com/Info.html"
     }
    }