ltm rule command IP idle timeout
iRule(1) BIG-IP TMSH Manual iRule(1)
IP::idle_timeout
Returns or sets the idle timeout value.
SYNOPSIS
IP::idle_timeout (TIMEOUT)?
DESCRIPTION
Returns the idle timeout value, or specifies an idle timeout value as
the criteria for selecting the pool to which you want the BIG-IP system
to send traffic.
RETURN VALUE
idle timeout value in seconds
VALID DURING
ANY_EVENT
EXAMPLES
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/portal" } {
IP::idle_timeout 3600
}
}
# Update the idle timeout for the client and serverside connection if a condition in the HTTP_REQUEST event is true. This could be a test to see if the request was for a specific URI.AX
when HTTP_REQUEST {
if {$some_condition == 1}{
log local0. "original timeout: [IP::idle_timeout]"
IP::idle_timeout 1801
log local0. "updated timeout: [IP::idle_timeout]"
set update_serverside_idle_timeout 1
}
}
when SERVER_CONNECTED {
log local0. "original timeout: [IP::idle_timeout]"
if {[info exists update_serverside_idle_timeout] && $update_serverside_idle_timeout}{
IP::idle_timeout 1802
log local0. "updated timeout: [IP::idle_timeout]"
}
}
# You can check the ltm log for the log output to see that the rule triggered.
# idle_timeout_rule : original timeout: 300
# idle_timeout_rule : updated timeout: 1801
# idle_timeout_rule : original timeout: 300
# idle_timeout_rule : updated timeout: 1802
# And you can check the b conn output for your client IP to see the idle timeout.
# b conn client 10.0.0.10 show all
# VIRTUAL 2.2.2.2:http <-> NODE any6:any
# CLIENTSIDE 10.0.0.10:4161 <-> 2.2.2.2:http
# (pkts,bits) in = (2, 960), out = (1, 528)
# SERVERSIDE 3.3.3.3:4409 <-> 3.3.3.4:80
# (pkts,bits) in = (3, 4952), out = (4, 2440)
# PROTOCOL tcp UNIT 1 IDLE 58 (1801) LASTHOP 4093 00
# Check the client's destination port
# Set the idle timeout based on the protocol
when CLIENT_ACCEPTED {
switch [TCP::local_port] {
20 -
21 -
22 {
# FTP, SSH: use a longer timeout
set idle 3600
IP::idle_timeout 3600
}
80 -
443 -
8080 -
8443 {
# HTTP and proxy ports: use a shorter timeout
set idle 300
IP::idle_timeout 300
}
default {
# Default port, use a middle length timeout
set idle 600
IP::idle_timeout 600
}
}
}
when SERVER_CONNECTED {
IP::idle_timeout $idle
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-9.0.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)