ltm rule command IP client addr
iRule(1) BIG-IP TMSH Manual iRule(1)
IP::client_addr
Returns the client IP address of a connection.
SYNOPSIS
IP::client_addr
DESCRIPTION
Returns the client IP address of a connection. This command is
equivalent to the command clientside { IP::remote_addr } and to the
BIG-IP 4.X variable client_addr.
RETURN VALUE
In BIG-IP 10.x with route domains enabled if the client is in any non-
default route domain, this command returns the client IP address in the
x.x.x.x%rd. For clients in the default route domain, it returns just
the IPv4 address.
VALID DURING
CLIENT_ACCEPTED, HTTP_REQUEST, HTTP_REQUEST_SEND, HTTP_RESPONSE,
IP_GTM, LB_SELECTED, SERVER_CONNECTED
EXAMPLES
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 10.10.10.10] } {
pool my_pool
}
}
# In BIG-IP 10.x with Route Domains:
when CLIENT_ACCEPTED {
# Check if client IP is 10.10.10.10, in route domain 100
if { [IP::addr [IP::client_addr] equals 10.10.10.10%100] } {
pool my_pool
}
}
when CLIENT_ACCEPTED {
# Check if client IP is 10.10.10.10, in any route domain
if { [IP::addr [getfield [IP::client_addr] "%" 1] equals 10.10.10.10] } {
pool my_pool
}
}
HINTS
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)