ltm rule command IP server addr
iRule(1) BIG-IP TMSH Manual iRule(1)
IP::server_addr
Returns the server's IP address.
SYNOPSIS
IP::server_addr
DESCRIPTION
Returns the server's (node's) IP address once a serverside connection
has been established. This command is equivalent to the command
serverside { IP::remote_addr } and to the BIG-IP 4.X variable
server_addr. The command returns 0 if the serverside connection has not
been made.
In BIG-IP 10.x with route domains enabled this command returns the
server's (node's) address once the serverside connection is established
in the x.x.x.x%rd if the server is in any non-default route domains
else it returns just the IPv4 address as expected.
RETURN VALUE
server's IP address
VALID DURING
HTTP_REQUEST_SEND, HTTP_RESPONSE, IP_GTM, SERVER_CLOSED,
SERVER_CONNECTED
EXAMPLES
when SERVER_CONNECTED {
log local0. "Node IP address: [IP::server_addr]"
}
# In BIG-IP 10.x this returns only the IPv4 portion of the address regardless of the route domain
when SERVER_CONNECTED {
log local0. "Node IP address: [getfield [IP::server_addr] "%" 1"
}
HINTS
The syntax checker will accept the use of IP::server_addr in additional
events which are not necessarily valid. CLIENT_ACCEPTED is one such
event, though it doesn't make sense to use a server command in that
event. Also, it does not appear that the command returns 0 if the
serverside connection has not been made.
SEE ALSO
CHANGE LOG
@BIGIP-9.2.2 -- Add to GTM @BIGIP-9.0.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)