SNAT iRule

Hi,

Quick one, have a subnet 10.1.1.0/24 & want to perform Vip bounce back, using snat_pool range 10.1.1.1 - 10

Bigip Self add is 10.1.1.11/24

Now if the requirement is incase http/https request is from another subnet dont SNAT.

If request is from the same subnet 10.1.1.0/24 SNAT it.

Can someone help me to write a iRule for this.

Thanks.

Hi,

If you create a SNAT pool containing the 10.1.1.1 - .10 IP’s named snatpool_10.1.1.0, you can use an iRule like this:

when CLIENT_ACCEPTED { 
  
     Check if client is in 10.1.1.0/24 subnet 
    if {[IP::addr [IP::client_addr] equals 10.1.1.0/24]}{ 
  
        Use the snatpool 
       snatpool snatpool_10.1.1.0 
    } 
 }

Aaron