15-Jul-2021 08:30
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]"
}
16-Jul-2021
00:28
- last edited on
04-Jun-2023
19:22
by
JimmyPackets
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
17-Jul-2021
00:50
- last edited on
24-Mar-2022
01:22
by
li-migration
Thank you
Will IP::server_addr give me the F5 Load Balancer's IP and LB::server pool pool member and pool name ?
17-Jul-2021 01:53
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.
17-Jul-2021
03:05
- last edited on
24-Mar-2022
01:22
by
li-migration
Thanks again
What value will return me the IP address of the F5 Load balancer?
17-Jul-2021 03:17
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.
https://clouddocs.f5.com/api/irules/IP__local_addr.html
17-Jul-2021
03:31
- last edited on
24-Mar-2022
01:23
by
li-migration
I am wanting to add the F5 local address into the HTTP response header to client, would local address value helps (server ---> F5 --> Client..
17-Jul-2021
04:00
- last edited on
04-Jun-2023
19:22
by
JimmyPackets
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.
17-Jul-2021 05:43
Thank you very much