Forum Discussion

Abuhasan_116587's avatar
Abuhasan_116587
Icon for Nimbostratus rankNimbostratus
Dec 20, 2018

Want to divert traffic to one pool only while other pool serves as standby from VIP

Hi , I have below requirement F5 LTM

 

VIP ------->>>>>Server 1(one site),Server 2 (another site)

 

Want to use one virtual IP only

 

By default traffic should not go through server 2 from VIP and it should go to Server 1 only

 

If server 1 is down traffic should go to server 2 . If server 1 is back again traffic should back to server 1

 

Can it be achieved in IRULE

 

Thanks Abu hasan

 

2 Replies

  • I have used below irule .Pls check any additional conditional can be used prior to deployment

     

    Create two pools Server1 and Server2

     

    when CLIENT_ACCEPTED { set noofpools [active_members Server1] if {$noofpools < 1 } { pool Server2 } else {pool Server1} }

     

  • You don't need an iRule for this functionality from what I can see of your requirements?

     

    Just set your pool up with priority group activation and configure to "less than 1 available member", then give pool member Server1 priority weight 10, and Server2 priority weight 5.

     

    This will route all traffic to Server1 only, and direct traffic to Server2 only if preferred member becomes available.

     

    You will also require an appropriate health monitor for the pool to check availability.