Forum Discussion

Ray_Sbrusch_941's avatar
Ray_Sbrusch_941
Icon for Nimbostratus rankNimbostratus
Oct 28, 2009

Preserving Client IP address for SMTP traffic

I know this topic has been discussed in the forums multiple times, but I never found implementation details which dont' require iRules or putting the BigIP in bridging mode.

 

 

I would like to be able to load balance SMTP servers with LTM, and have the SMTP servers see the original IP address of the sender.

 

 

We have already changed the default gateway of the SMTP servers to the floating IP of the F5 units. I have SNAT Pool set to None, and Address Translation and Port Translation enabled.

 

 

When I connect with telnet to port 25 on the virtual server, the connection is quickly closed before I can even finish HELO.

 

Can someone share implementation details?
  • I'm trying the same thing but with SSH instead of SMTP. I've pointed my servers to use the LTM floating IP as their GW and the Virtual Server SNAT Pool to None, AutoMap, and custom SNAT. In each attempt my client IP was logged as being one of the SNAT IPs. Could this be because I am configured on legged (all on one VLAN)?

     

     

    Is there a way of getting this to work within a single VLAN, or do I need to have my Virtual Server in one VLAN and my server Pool and SNAT in a different VLAN? Any light on what I might be missing would be grateful.

     

     

    Thanks,

     

    -uriah
  • Hi I'm facing the same problem as what Ray Sbrusch described, and I couldn't find a solution. I need the smtp server to see the actual client IP (at the same time traffic being loadbalanced) instead of the SNAT VIP so I can do accounting. Seems after I disable the SNAT, the loadbalancer doesn't even send the traffic to the SMTP server as I can't see any connection from actual client in the smtp monitoring page. I understand I can do a IP forwarding but that'll disable the laodbalancing.
  • Hi Albert,

     

     

    You could change the server's default gateway to be the LTM self IP address. Or you could use nPath (direct server return) to avoid needing SNAT.

     

     

    Aaron
  • Hi,

     

    I read the full conversation. I have a similar configuration to the customer but unfortunately has a SMTP load balance with SNAT enabled, the customer has other services configured in this way also, but for this particular SMTP VS would to allow to see the Original IP address by the SMTP real servers, I think for logging purposes.

     

     

    Is it possible to add into the Virtual Server configuration a similar "X-Forwarded-For" but only for SMTP?

     

    Thanks.

     

    Regards

     

    Fabrizio.

     

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    There's nothing in SMTP to allow that. But what you could do is set the client ip in one of the tcp option headers (See the devcentral iRUle page on TCP::options).

     

     

    It's up to the software (i.e. the SMTP server) to pull that info though and use it.

     

     

    H
  • Hi Ray,

    I have similar requirement, can you please help me with the solution.

    Requirement :- We have SMTP server which are getting load balance via F5 LTM and we want to see Client IP address instead of SNAT.

    Regards,

    Raqs

  • Hi Team,

    Hope you all are doing good.

     

    Please update on above request.

    • A new question is probably a better way to go, this one has different questions together.

      You might be able to stop using Source Address translation and get the real IP. But that depends on your network setup. Can you come up with a network diagram?

      Beyond that there are no real options. someone suggests the TCP options, but that is a long shot, what is your SMTP server brand / vendor?