Forum Discussion

schmal_111133's avatar
schmal_111133
Icon for Nimbostratus rankNimbostratus
Feb 13, 2013

specific source port translation

Hi,

 

I am trying to do SNAT while selecting a specific port for that but for some reason when the F5 receive the response it is sending a RST to the WS and not retranslating it to the original IP and port.

 

I configured the below:

 

when CLIENT_ACCEPTED {

 

set PublicIP 10.107.200.200

 

snat $PublicIP 12345

 

}

 

 

I can see that connection was created:

 

 

VIRTUAL any <-> NODE 173.194.47.19:80 TYPE any 1/3

 

CLIENTSIDE 10.107.200.140:51251 <-> 173.194.47.19:80

 

(pkts,bits) in = (2, 120) out = (0, 0)

 

SERVERSIDE 10.107.200.200:12345 <-> 173.194.47.19:80

 

(pkts,bits) in = (0, 0) out = (2, 120)

 

PROTOCOL 6 UNIT 1 IDLE 2 (300) LASTHOP WDN_MIG_Internal 00:14:5e:a8:0a:04

 

 

This the tcpdump from the F5:

 

19:22:02.182260 IP 10.107.200.200.12345 > 173.194.47.19.80: S 1731136945:1731136945(0) win 5840

 

19:22:02.264415 IP 173.194.47.19.80 > 10.107.200.200.12345: S 718544173:718544173(0) ack 1731136946 win 1460

 

19:22:02.264439 IP 10.107.200.200.12345 > 173.194.47.19.80: R 1:1(0) ack 1 win 0

 

 

Do you have any idea why the F5 behave in that way?

 

 

Thanks a lot.

 

 

 

 

34 Replies

  • right now my biggest issue with the above is the TMM issue, when I disable the CMP everything works perfect but of course I cannot disable the CMP on production system.

     

    I will be happy if you will take a look on the irule and write any comments if you have some..
  • I didn't exactly understood how you can determine which TMM will handle the traffic when the traffic return to the F5 and not leaving it.. it is source port XOR destination port MOD total number of tmm instances.

     

     

    for the irule, i think TCP::unused_port may be useful (because you have to select correct snat port and it must be available to use).

     

     

    TCP::unused_port wiki

     

    https://devcentral.f5.com/wiki/iRules.TCP__unused_port.ashx
  • Thanks for the reply :)

     

     

    for the irule, i think TCP::unused_port may be useful (because you have to select correct snat port and it must be available to use).

     

     

    TCP::unused_port wiki

     

    https://devcentral.f5.com/wiki/iRules.TCP__unused_port.ashx

     

     

     

    The thing is that the virtual server that I am doing the SNAT using for UDP and TCP and all other protocols do to SNAT, the VS type is IP (Forwarding) with all protocols.
  • there is UDP::unused_port as well.

     

     

    UDP::unused_port wiki

     

    https://devcentral.f5.com/wiki/iRules.UDP__unused_port.ashx