Forum Discussion

Nyuk_Loong_Kiw_'s avatar
Nyuk_Loong_Kiw_
Icon for Nimbostratus rankNimbostratus
Jan 23, 2007

using irule to SNAT SMTP connections

Hi all,

 

 

Refer to attachment for what i am trying to setup

 

 

I need to SNAT outbound SMTP communication from both mail server A as well as mail server B to the same IP as the Virtual IP address that's currently configured, my problem is i only want to SNAT SMTP communication and nothing else (server A and B need to talk to DC/DNS etc un-NATted).

 

 

I understand that the only way to selectively SNAT is to use irule, and from my understanding i have to associate an irule to a virtual server, is what i am trying to setup something doable on F5 V9?

 

 

Thanks

 

 

 

kiw

1 Reply

  • make a wildcard forwarding virtual server for outbound connections

     

     

     

    virtual wildcard_fwd_vs {

     

    destination any:any

     

    mask none

     

    ip protocol tcp

     

    }

     

     

    and assign an iRule:

     

     

    when CLIENT_ACCEPTED {

     

    switch [ IP::client_addr ] {

     

    10.0.0.1 { snat 10.0.200.1 } <<< this is mail server A being snat'd to the mx record address

     

    10.0.0.2 { snat 10.0.200.1 } <<< and mail server B to the same address

     

    default { snat none } <<< nothing else gets changed

     

    }

     

    }