Forum Discussion

Mick_Thompson_6's avatar
Mick_Thompson_6
Icon for Nimbostratus rankNimbostratus
Aug 29, 2006

Redirect based on source IP

Hi,

 

I am looking to find the best way to redirect all requests made to a virtual Server to be redirected to a another Pool or server, except for serveral IP addresses that would need access to the Virual Server .

 

 

 

Thanks

 

 

Mick

7 Replies

  • Click here for an example of using HTTP::redirect. There's also some other forum posts showing how to do if statements for client IP's.

     

     

    Denny
  • Thanks for the reply, but I think I need to do something similar to the irule below but I need to match several IP addresses.

     

     

     

    when CLIENT_ACCEPTED {

     

    if { [IP::addr [IP::remote_addr] equals 206.0.0.0/255.0.0.0] } {

     

    pool clients_from_206

     

    } else {

     

    pool other_clients_pool

     

    }

     

    }
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    Then your best bet would be to create a DataGroup of IP addresses and switch to using the command "matchclass".
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    Well, if you the external BIGIP is SNAT'ing then you would need to insert an X-Forwarded-For header (or equivalent) and then check against that (again, assuming you are implementing this check on the inside BIGIP). However, I would wonder why the check couldn't be done in the external firewall or whether you really need SNAT enabled...