Forum Discussion

Sam10's avatar
Sam10
Icon for Altostratus rankAltostratus
Oct 16, 2019

client connection persistence

We have 2 source and i am trying to force each source to 1 node behind the lbs. Below irule is not working as expected I see a reset from f5 no traffic passing to the pool member

 

when CLIENT_ACCEPTED {

  # get the default load-balancing pick

 set mypick [LB::select]

 if { (([IP::client_addr] == "192.168.1.2") && ([LB::status pool qa_443 member 10.12.4.252 443] eq "up")) } {

      pool qa_443 member 10.12.4.252

  }

  elseif { (([IP::client_addr] == "192.168.1.3") && ([LB::status pool qa_443 member 10.12.4.253 443] eq "up")) } {

      pool qa_443 member 10.12.4.253

  } else {

     # the default pick is chosen

     eval $mypick

  }

}

 

  • Hi Sam10,

    Can you try this?

    when CLIENT_ACCEPTED {
    	if { ([IP::client_addr] equals "192.168.1.2") && ([LB::status pool qa_443 member 10.12.4.252 443] eq "up") } {
    		pool qa_443 member 10.12.4.252 443
    	}
    	elseif { ([IP::client_addr] equals "192.168.1.3") && ([LB::status pool qa_443 member 10.12.4.253 443] eq "up") } {
    		pool qa_443 member 10.12.4.253 443
    	}
    	else {
    		pool default_pool
    	}
    }