Forum Discussion

Andre_Nurwono_1's avatar
Andre_Nurwono_1
Historic F5 Account
Jan 20, 2005

To SNAT or not to SNAT

I thought I'd finally try to post this in devcentral since it seems like something some people might want.

I've had run into several questions in the past where we have a scenario similar to the following:

- The site needs to use snatpools for outbound link (ISP) load-balancing

- The site has public IP addresses inside the BIG-IP.

The public address must not be SNATted when going

out the first ISP.

However if the first ISP fails they want to be able to go out

snatted via the second ISP.

Let's say the first ISP's router is 1.1.1.254 and the second ISP's router is 2.2.2.254, while the internal address is 1.3.3.3

   
  when LB_SELECTED {  
    if {[IP::client_addr] == "1.3.3.3"} {  
      if {[LB::server addr] == "2.2.2.254"} {  
        snat automap  
      }  
      else {  
        snat none  
      }  
    }  
    else {  
      snat automap  
    }  
  }  
    
  when CLIENT_SELECTED {  
    if {[IP::cliet_addr] == "1.3.3.3"} {  
      pool isp1firstpool  
    }  
    else {  
      pool defaultgatewaypool  
    }  
  }  
 

The effect above is that we can SNAT outbound connections from that specific IP address only when it falls back to ISP2, while if the connection goes via ISP1 it does not get SNATted (snat none).

Will "snat none" preempt any global snat or snat automap settings that was configured somewhere else?

Also, our Presales engineers (consultants) are asking whether we have a reference for the "snat none" syntax and LB_SELECTED documentation in any of our manuals?

Thanks!

-Andre

  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account

     

    Will "snat none" preempt any global snat or snat automap settings that was configured somewhere else?

     

     

    ==> YES

     

     

    However, any subsequent snat command could effectively re-enable it.

     

     

     

    Also, our Presales engineers (consultants) are asking whether we have a reference for the "snat none" syntax and LB_SELECTED documentation in any of our manuals?

     

     

    Our documentations folks are working on an update for the iRules manual for a release after 9.0.5.