Forum Discussion

Levin_Chen_1516's avatar
Levin_Chen_1516
Icon for Nimbostratus rankNimbostratus
Nov 26, 2008

How to write iRules for log client IP in snat to smtp server?

Hi

 

 

All Experts. I have encountered a thorny problem in need of help.

 

 

In the past, to record the client IP in http server log. I can use enable X-forward or insert other header by iRules. But if server is smtp server. And forward data by snat.How to write iRules for log client IP in snat to smtp server?

 

 

Thank you!

2 Replies

  • Hi there,

     

     

    You can check this post for some suggestions on handling SNAT for SMTP virtual servers. They discuss changing routing as well as how to/issues with logging the client details on LTM.

     

     

    SNAT Pass the source IP to the sever (SMTP) (Click here)

     

     

    The basic idea is that it would be easier to change the routing configuration for load balancing the SMTP servers to eliminate the SNAT rather than trying to modify the SMTP headers to insert a custom header.

     

     

    SMTP does support arbitrary header names (which typically start with X-), but there isn't native support in iRules to parse SMTP and insert a header. So you'd have to collect the TCP data, modify it, and send it to the pool. As AaronB pointed out in the linked post, you'd have to worry about collecting more than 4Mb of TCP data (Click here). Most SMTP messages could easily be above this limit.

     

     

    Aaron