Forum Discussion

Richard_D's avatar
Richard_D
Icon for Altostratus rankAltostratus
Oct 13, 2021
Solved

iRule: Direct request to specific server, but you use pool if that server is down not working.

I tried to use the resources to create an iRule to force specific users (via IP) to connect to a specific server in the pool. Any other user will just hit the pool as usual which round robins. The pr...
  • MaximP's avatar
    Oct 13, 2021

    Hi Richard.

    I suggest that you need to check pool member state before node choosing

     

    when CLIENT_ACCEPTED {

     if {[IP::addr [IP::client_addr] equals A.A.A.A] } {

    if { [LB::status pool SERVICE_60006_pool member 1.1.1.1 60006] != up } {

    pool SERVICE_60006_pool

    }

    else {

    node 1.1.1.1 60006

    }

     } 

     elseif {[IP::addr [IP::client_addr] equals B.B.B.B] } {

    if { [LB::status pool SERVICE_60006_pool member 2.2.2.2 60006] != up } {

    pool SERVICE_60006_pool

    }

      else { node 2.2.2.2 60006 

    }

     }

     else {

      pool SERVICE_60006_pool

     }

    }