Forum Discussion
SNAT Pass the source IP to the sever
I have a Virtual Server, of SMTP protocol.
The problem is that in the log mail servers i see that all the connections are from the VS, and i cannot see the IP of the client.
So is there any way to pass the source Ip of the client to the mail server (thorugh the BIGIP)
I have configured the VS with SNAT in AUTO mode.
I don´t know how to solve this problems. Does anybody help me?
Thanks in advance
Best regards
- Richard_Kim_270
Nimbostratus
I don't think SNAT will pass source IP unless you use the X-Forwarded-For. Let's hear what the experts have to say. - Deb_Allen_18Historic F5 AccountSNAT replaces the client sourceIP.
- Do you have a case number where that information was given, Nacho? If appropriate that's something I'd like to chase up internally.
- Nacho_de_Aguina
Nimbostratus
Here you have the case C323708 - Thank you Nacho, I will have a word with the NSE in question regarding his advice;
rule log_smtp_connections { when SERVER_CONNECTED { log local0. "SMTP connection from [IP::client_addr]:[TCP::client_port]. \ Mapped to [serverside {IP::local_addr}]:[serverside {TCP::local_port}] \ -> [IP::server_addr]:[serverside {TCP::remote_port}]" } }
- Nacho_de_Aguina
Nimbostratus
Ok thanks a lot - Brian_DeKemper_
Nimbostratus
Aaron- - JRahm
Admin
You don't need an iRule to insert the source IP with http. In the http profile, enable the field Insert XForwarded For. For the isapi filter, there are instructions for this: - Brian_DeKemper_
Nimbostratus
Thanks for the info. I went the link you provided and for IIS, it gave me the following steps, but I'm still not getting the source IP passed to the webserver. Any ideas?
1: Enable X-Forwarded-For
(I was able to 'enable' the Insert Xforward For in the HTTP profile that I use)
To configure the BIG-IP system to insert the original client IP address in an X-Forwarded-For header, perform the following procedure:
Log in to the BIG-IP Configuration utility.
Click Local Traffic.
Click Profiles.
Click HTTP from the Services drop-down menu.
Click the Create button.
Type a name for the HTTP profile.
Check the checkbox next to Insert XForwarded For.
A drop-down menu appears.
Select Enabled from the drop-down menu.
Click Finished.
2: Download the ISAPI Filter and install on IIS webserver
(I was able to download this and I am using the ISAPI filter in the top-level 'RELEASE' folder when I add it to my IIS website. Let me know if I need to use a different ISAPI filter for my Windows 2003, 32-Bit webserver.)
You can configure the IIS web server to extract the IP address from the X-Forwarded-For header and log the IP address to the web server log file. To do so, you will need to download and install the IIS X-Forwarded-For ISAPI Log Filter from https://cdn.f5.com/websites/devcentral.f5.com/downloads/F5XForwardedFor.zip.
The IIS ISAPI filter will look for the X-Forwarded-For header in the HTTP request. If the IIS ISAPI filter finds an X-Forwarded-For header in the HTTP request, it will replace the client IP address in the W3SVC log traces with the value of the X-Forwarded-For header.
To download and install the IIS X-Forwarded-For ISAPI Log Filter, perform the following procedure:
Log on to http://devcentral.f5.com.
Select iControl Code Share from the Downloads menu.
Download the IIS Proxy X-Forwarded-For Log Filter.
To install the ISAPI filter, add it to your IIS Web Site using the IIS administrative utility.
3: Configure iRule
(the IP wasn't showing up in my IIS logs after the first two steps above, so I also setup this iRule for my virtual servers)
iRule
To configure the BIG-IP system to insert the original client IP address in a header using an iRule, perform the following procedure:
Log in to the BIG-IP Configuration utility.
Click Local Traffic.
Click iRules.
Click the Create button.
Type a name in the Name field.
Copy and paste the following iRule in the Definition field:
when HTTP_REQUEST {
HTTP::header insert ORIG_CLIENT_IP [IP::remote_addr]
}
- draco_184361
Nimbostratus
Hey
So for loadbalancing smtp server , we can choose http profile with tcp 25 and enable x forwarder in http profile?doesn't it require smtp profile to understand the smtp traffic ?
- jforaker
Nimbostratus
Does anyone know the configuration needed on an iplanet/sun one webserver to log the X-Forwarded-For variable?
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com