Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

whatismyip on the internal network

Is it possible to create an irule that would capture a users IP address and then provide it back to them in the browser? We have users that have a hard time figuring out how to get their IP address from that PC. I wanted to create a VIP (with no assigned server pool) and apply an irule that would capture the IP address and respond back to the user in the browser with their IP address. Has anyone created this before? If so, can you help me?

 

Thanks

 

2 REPLIES 2

Kevin_Stewart
F5 Employee
F5 Employee

Something like this?

when HTTP_REQUEST {
    HTTP::respond 200 content "Your IP address is: [IP::client_addr]"
}

Trying to add this to a complex page being written by an irule that declares the HTML content in curly braces, like this:

   HTTP::respond 200 content {

    <html>

.....

}

 

If I put the "[IP::client_addr]" into the bracketed content, it prints out [IP::client_addr] instead of the value. How do I get it to do the substitution and print the actual value?