Forum Discussion

fgiang_29519's avatar
fgiang_29519
Icon for Nimbostratus rankNimbostratus
Jun 05, 2017

IRule to forward to a specific member of a pool based on the request IP

I saw a number of solutions using two pools in the forum to solve the issue below. I am wondering if we can have an IRule to achieve the same thing with a single pool.

 

So it's like this: supposed that the pool poolTest has 4 members: 1. 10.10.10.1:80 2. 10.10.10.2:80 3. 10.10.10.3:80 4. 10.10.10.4:80

 

Is it possible to have an IRule such that

 

if { [IP::addr [IP::client_addr] equals xxx.xxx.xxx.xxx] } { node 10.10.10.2:80 } else { pool poolTest EXCEPT NODE 10.10.10.2:80 }

 

Thanks for any advice and suggestion to this question.

 

1 Reply

  • We haven't see

    pool poolTest EXCEPT NODE 10.10.10.2:80
    event[EXCEPT] in pool. I will suggest you to created two pool & forward request.

            when HTTP_REQUEST {
                 if { [IP::addr [IP::client_addr] equals x.x.x.x/32] } {
                        pool pool_1 } 
                        else { pool pool_2 }
             }