clear tcp-forwarding connections
Syntax
Release Information
Command introduced in Junos OS Release 18.3R1 on MX Series routers.
Description
Clear all TCP connections, all connections associated with a specific listening port/listening address combination, or a single connection pair represented by a specific source address/source port combination. For either combination, you can optionally specify a routing instance. If you do not specify a routing instance, the default routing instance is assumed. This command enables you to disconnect TCP port forwarding connections that are not behaving properly.
Options
Range: 8000 through 8031
Range: 1 through 65,535
Required Privilege Level
view
Related Documentation
List of Sample Output
clear tcp-forwarding connectionsclear tcp-forwarding connections (Listening Port and Address)
clear tcp-forwarding connections (Source Address and Port)
Output Fields
When you enter this command, you are not provided feedback on the status of your request.
Sample Output
clear tcp-forwarding connections
user@host> clear tcp-forwarding connections
clear tcp-forwarding connections (Listening Port and Address)
The following sample output displays the TCP connection status for a specific listening port/address combination before and after the connection is cleared.
user@host> show tcp-forwarding status listening-port
203.0.113.50 listening-address 8002
Listening on: [default:]203.0.113.50:8002 Status: listening Total Bytes Rx: 1230 Tx: 482 Forwarding to: [default:]192.0.0.4:830 Total Bytes Rx: 482 Tx: 1230 Allowed Source Prefixes: 198.51.100.3/32 Connections Max: 1 Active: 1 Source: 198.51.100.3:55002 Listening: connected Bytes Rx: 0 Tx: 0 Forwarding: connected Bytes Rx: 0 Tx: 0
user@host> clear tcp-forwarding connections
listening-port 8002 listening-address 203.0.113.50
user@host> show tcp-forwarding status listening-port
8002 listening-address 203.0.113.50
clear tcp-forwarding connections (Source Address and Port)
The following sample output displays the TCP connection status before and after the connection is cleared.
user@host> show tcp-forwarding status
Listening on: [default:]203.0.113.50:8020 Status: listening Total Bytes Rx: 292 Tx: 112 Forwarding to: [default:]198.51.100.1:49 Total Bytes Rx: 112 Tx: 292 Allowed Source Prefixes: 192.0.0.1/24 Connections Max: 4 Active: 3 Source: 192.0.0.2:55000 Listening: connected Bytes Rx: 380 Tx: 223 Forwarding: connected Bytes Rx: 223 Tx: 380 Source: 192.0.0.3:55000 Listening: connected Bytes Rx: 855 Tx: 411 Forwarding: connected Bytes Rx: 411 Tx: 855 Source: 192.0.0.4:56022 Listening: connected Bytes 642 Tx: 350 Forwarding: connected Bytes Rx: 350 Tx: 642
user@host> clear tcp-forwarding connections
source-address 192.0.0.2 source-port 55000
user@host> show tcp-forwarding status
Listening on: [default:]203.0.113.50:8020 Status: listening Total Bytes Rx: 292 Tx: 112 Forwarding to: [default:]198.51.100.1:49 Total Bytes Rx: 112 Tx: 292 Allowed Source Prefixes: 192.0.0.1/24 Connections Max: 4 Active: 2 Source: 192.0.0.3:55000 Listening: connected Bytes Rx: 855 Tx: 411 Forwarding: connected Bytes Rx: 411 Tx: 855 Source: 192.0.0.4:56022 Listening: connected Bytes 642 Tx: 350 Forwarding: connected Bytes Rx: 350 Tx: 642