For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

TNY_122436's avatar
TNY_122436
Icon for Nimbostratus rankNimbostratus
Oct 14, 2015

iRule snat to certain pool member

Hello,

 

I have a VIP that load balances to two pool members: poolA and poolB. PoolA takes priority, but if and when traffic gets load balance to poolB, it needs to use a snat of 192.168.1.1. How can I write an iRule to make this work?

 

2 Replies

  • try this:

    when LB_SELECTED { 
       if {[IP::addr "[LB::server addr]" equals "1.2.3.4"]} { 
          snat automap
       }
    }
    
  • when LB_SELECTED { 
        set poolBaddr "4.3.2.1"
        set snatAddr "1.2.3.4"
       if {[IP::addr "[LB::server addr]" equals $poolBaddr]} { 
          snat $snatAddr
       }
       unset poolBaddr
       unset snatAddr
    }