F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

VFB's avatar
VFB
Icon for Cirrus rankCirrus
Jun 22, 2018

SNAT local address going to a specific port

I'm trying to SNAT a subnet going to a specific port but not getting anywhere with the iRule. Below is what I currently have:

 

when CLIENT_ACCEPTED { if {[IP::addr [IP::client_addr] equals "10.10.10.0/28"]} and {[UDP::local_port] equals "1700"]} {snat "10.10.10.1"}}

 

1 Reply

  • Braces and brackets are a bit misaligned. Try the following which should at least be syntactically correct:

    when CLIENT_ACCEPTED {
        if { [IP::addr [IP::client_addr] equals "10.10.10.0/28"] && [UDP::local_port] equals "1700" } {
            snat "10.10.10.1"
        }
    }