TCP::remote_port¶
Description¶
Returns the remote TCP port/service number of a TCP connection. This
command is equivalent to the BIG-IP 4.X variable remote_port. When
used in a clientside context, this command returns the client-side TCP
source port, and is equivalent to the
TCP::client_port command. When used in
a serverside context, this command returns the server-side TCP
destination port, and is equivalent to the
TCP::server_port command.
Syntax¶
TCP::remote_port [ clientside | serverside ]
TCP::remote_port¶
- Returns the remote TCP port/service number of the current context’s TCP connection.
TCP::remote_port clientside¶
- Returns the remote TCP port/service number of the client-side TCP connection.
TCP::remote_port serverside¶
- Returns the remote TCP port/service number of the server-side TCP connection.
Examples¶
when HTTP_REQUEST {
if { [HTTP::uri] contains "/secure/" } {
pool ssl_pool
} else {
pool http_pool
}
}
when SERVER_CONNECTED {
if {[TCP::remote_port] != 443} {
SSL::disable
}
}
when SERVER_CONNECTED {
# This logs information about the TCP connections on *both* sides of the full proxy
set client_remote "[IP::client_addr]:[TCP::client_port]"
set client_local "[IP::local_addr clientside]:[TCP::local_port clientside]"
set server_local "[IP::local_addr]:[TCP::local_port]"
set server_remote "[IP::server_addr]:[TCP::server_port]"
log local0. "Got connection: Client($client_remote)<->($client_local)LTM($server_local)<->($server_remote)Server"
}
Example output:
<SERVER_CONNECTED>: Got connection: Client(10.3.3.20:33798)<->(10.3.3.111:80)LTM(10.1.1.110:33798)<->(10.1.1.200:80)Server