Forum Discussion
f5now_28704
Nimbostratus
Dec 17, 2008passing client IP to server
hey crew,
I have a server app that requires the client IP pop in the ASPX. I tried some irules I had found in the forums.. they did work... not sure where to look to have this work.
client ASPX string..
String IP = HttpContext.Current.Request.UserHostAddress
currently its popping up with the F5 interface IP.
Ryan
2 Replies
- JRahm
Admin
I assume you are using the snat feature on the F5 and that it is not the default gateway? If this is the case, you'll want to enable the Insert XForwarded For header in the http profile and configure your app to read this header to retrieve the source IP of the user. - f5now_28704
Nimbostratus
Hi,
sorry I had posted this and next day we had a power failure and I had forgot I posted...
anyway, thanks.. this worked for me, I enabled the profile-http for "Insert XForwarded For" to enable and that passed the client IP to my server where I wrote this to catch and display it in ASP.
<%@ LANGUAGE="VBSCRIPT" %>
Grab IP Address
<% ClientIP=Request.ServerVariables("HTTP_X_FORWARDED_FOR")%>
Your IP Address is<% Response.Write(ClientIP)%>Thanks Again.Ryan
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
