Forum Discussion

penghon_71315's avatar
penghon_71315
Icon for Nimbostratus rankNimbostratus
Oct 17, 2008

Showing snat automapped IP

Is it possible to obtain the snat automap IP from any irule commands **before** the packet is snat automapped out to the pool members?

2 Replies

  • I think the only way you could get the SNAT address would be to check the IP::local_addr value once the server side connection has been established in SERVER_CONNECTED (Event descriptions: Click here, some related tests: Click here). So I believe the answer is no.

     

     

    This could potentially be determined in LB_SELECTED once the pool member is selected, but I don't think there are any commands which would tell you what IP address will be used to source the traffic. LB::snat sounded promising, but it just returns 'snat automap' (or when a snat pool is configured 'snatpool snat_pool_name'), not the IP which will be used.

     

     

    What are you trying to do?

     

     

    Aaron
  • You are correct about the event SERVER_CONNECTED, using IP::local_addr (or something similar, cannot remember off hand right now) to obtain the SNAT automap IP used for the connection to the pool member.

     

    But this would have been too late as the packet would have gone out to the pool member.

     

     

    While there might be a better way to do this, I am trying to use an irule to change the Via header off a SIP REGISTER packet, replacing the client source IP with a SNAT automapped IP via an LC with 3 ISP links.

     

    While I can change the client source IP with hardcoded snat IP, being able to replace the IP automatically is a good thing. As to why i am changing the VIA header...its just for testing the SIP protocol and not for production.