ltm rule command virtual
iRule(1) BIG-IP TMSH Manual iRule(1)
virtual
Returns the name of the associated virtual server or selects another virtual server and an optional IP address and port to
connect to.
SYNOPSIS
virtual
virtual (name | VIRTUAL_SERVER_OBJ) (IP_TUPLE | (IP_ADDR (PORT)?))?
DESCRIPTION
Returns the name of the associated virtual server that the connection is flowing through. In 9.4.0 and higher, it can be
also used to route the connection to another virtual server and an optional IP address and port, without leaving the BIG-
IP.
Syntax
virtual name
* Return the name of the associated virtual server.
virtual [[:|.| ]]
* Route the traffic to a virtual server and an optional IP address
and port instead of normal server selection by load balancing.
Note: In version 9.4.0 and higher, virtual or virtual name
returns the current virtual server's name. In previous versions, only
virtual name returns the current virtual server's name.
Note: In version 9.4.0 and higher, 'virtual ' can be used to route the
connection to another virtual server and an optional IP address and port,
without leaving the BIG-IP. This functionality did not exist in previous
versions. When no IP address is specified one must precede the virtual
command with an LB::reselect command if a pool member has already
been selected.
Note: In version 9.4.0 and higher, you can disable cmp on a virtual
server. If you disable cmp on the post processing virtual server,
ensure that the front virtual server is also cmp disabled.
RETURN VALUE
VALID DURING
ANY_EVENT
EXAMPLES
when HTTP_REQUEST {
log local0. "Current virtual server name: [virtual name]"
}
when HTTP_REQUEST {
# Send request to a new virtual server
virtual my_post_processing_server
}
when HTTP_REQUEST {
# Send request to a new virtual server and a designated IP address.
# This can be a node, SNAT, pool member, virtual server, etc.
virtual my_post_processing_server $ip_tuple
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-9.0.0 --First introduced the command.
BIG-IP 2022-04-12 iRule(1)