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

Insert LTM IP and pool member IP in header in the response to client

R_S
Nimbostratus
Nimbostratus

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]"

}

 

8 REPLIES 8

SanjayP
MVP
MVP

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
Nimbostratus
Nimbostratus

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.

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.

https://clouddocs.f5.com/api/irules/IP__local_addr.html

 

 

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.

Thank you very much