R_S
July 15, 2021, 3:30pm
1
Hi
I want to insert the header in the response to client with the IP address of the LTM pool member that served the request and the Big-IP LTM IP address?
What is the difference between IP::local_addr and IP::server_addr ?
Is below a correct iRule.
when HTTP_RESPONSE {
HTTP::header insert “[IP::server_addr]:[IP::local_addr]”
}
You can use something like below.
when HTTP_RESPONSE {
HTTP::header insert lb_server "[IP::server_addr]:[TCP::server_port]"
}
Alternatively, you can just use [LB::server], which will print the pool name as well along with the member
R_S
July 17, 2021, 7:50am
3
Thank you
Will IP::server_addr give me the F5 Load Balancer’s IP and LB::server pool pool member and pool name ?
No. IP::server_addr will give you node IP address (without port). TCP::server_port will give node port.
But if you just use LB::server it will give you node IP, port (member) and pool name.
R_S
July 17, 2021, 10:05am
5
Thanks again
What value will return me the IP address of the F5 Load balancer?
You can useIP::local_addr for F5 IP address. Please note, on clientside events (client --> F5) it returns VIP IP addr. And on serverside (F5 ---> server) it returns self IP address that will talk to server (offcouse if SNAT is enabled)
take a look at below article.
R_S
July 17, 2021, 10:31am
7
I am wanting to add the F5 local address into the HTTP response header to client, would local address value helps (server ---> F5 --> Client..
When you say local IP address, I’m assuming you are mentioning F5 selfIp address?
Below iRule will insert f5_server header with value of <f5_floating_selfIP>__<node_ip>.
when HTTP_RESPONSE {
HTTP::header insert f5_server "[IP::local_addr]_[IP::server_addr]"
}
I think I overlooked your original request and iRule.my bad. So your original iRule was ok, I would just add name of the header. Hope this helps.