Forum Discussion

adiezma_1656's avatar
adiezma_1656
Icon for Nimbostratus rankNimbostratus
Nov 14, 2011

Redirect two conn to pool, and other conn to default pool

Hi!,

 

 

 

I Need a IRule to redirect the connections of two ip's to a pool, and other connections to another pool.

 

I tested with:

 

 

When HTTP_REQUEST {

 

if { [IP :: addr [IP :: client_addr ] equals xxxx ]} {

 

my pool pool_id

 

} Else if {[ IP:: addr [IP :: client_addr ] equals xxxx ]} {

 

my pool pool_id

 

}

 

}

 

 

No work, no redirects

 

 

The problem is that there is a proxy in the middle and translates the source addresses.

 

 

Need the same for a VS with port 443

 

 

I need Help! haha, please!

 

 

 

A. Diezma

 

  • does proxy insert x-forwarded-for header?

     

     

    if yes, can you try this?

     

     

    Route Traffic Based on Header Info

     

    http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1176873/showtab/groupforums/Default.aspx
  • Great! it works!

     

     

    I applied:

     

     

    When HTTP_REQUEST {

     

    if {[HTTP:: header "X-Forwarded-For"] contains "x.x.x.164"} {

     

    pool my_pool }

     

    elseif {[HTTP:: header "X-Forwarded-For"] contains "x.x.x.167"} {

     

    pool my_pool }

     

    WEB} else {pool default_pool

     

    }

     

     

    Now I need another just to VS_port 443

     

     

    Thanks a lot!!

     

     

    Antonio
  • just in case there is more than one x-forwarded-for header.

     

     

    Using X-Forwarded-for to block Clients?

     

    http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1174108/showtab/groupforums/Default.aspx

     

     

    cheer!
  • Don't use xff for blocking, only for testing website

     

     

    Again, thank you very much

     

     

    Solved!

     

  • Don't use xff for blocking, only for testing website sorry i did not explain well. actually, i just want to point how we parse x-forwarded-for header if there is more than one.