Forum Discussion

Raunak_Tiwari's avatar
Icon for Nimbostratus rankNimbostratus
Dec 07, 2020

Route Traffic between multiple pools based on Client IPs and XFF(same as Client IPs).

Hello Folks,


I have to divert the traffic between the Pool members based on the Client IPs and XFF headers(Contains the IPs same as condition 1).


I have created the IRule but still but I am facing issue with it.


Scenario :-

I have multiple websites some of them are coming from the WAF as source IP and some of them are landing directly to my F5 LTM, based on this condition I have created an IRule to match Client IPs either in Source address or in XFF. Rest of the traffic will land to default pool.



 if {( [class match [IP::client_addr] equals FED_ACCTEST_datagroup] ) } { 

  pool Federation-ACC-444 

 } elseif {( [class match [HTTP::header "Incap-Client-IP"] equals FED_ACCTEST_datagroup] ) } { 

  pool Federation-ACC-444

 } else {

  pool Fedration-ACC



Note :- In this IRULE only 3rd condition for the default pool is not working else everything is OK!

1 Reply

  •  Can you verify if requests is actually coming till 3rd statement? Also if you have only this iRule on the Virtual Server then you can define Pool - Fedration-ACC as a default pool on the VS. So it will get match at the end. So if any of the iRule statement is not matching e.g. first two statements, traffic will be forwarded to the default pool.