|
|
This chapter describes TCP Intercept commands. TCP Intercept is a traffic filtering security feature that protects TCP servers from TCP SYN-flooding attacks, which are a type of denial-of-service attack. TCP Intercept is available for IP traffic only.
Refer to the Command Reference Master Index or search online to find complete descriptions of other commands used when configuring TCP Intercept.
For TCP Intercept configuration information, refer to the "Configuring TCP Intercept (Prevent Denial-of-Service Attacks)" chapter in the Cisco IOS Security Configuration Guide.
To change how long a TCP connection will be managed by the TCP intercept after no activity, use the ip tcp intercept connection-timeout command in global configuration mode. Use the no form of this command to restore the default.
ip tcp intercept connection-timeout seconds
Syntax Description
seconds Time (in seconds) that the software will still manage the connection after no activity. The minimum value is 1 second. The default is 86,400 seconds (24 hours).
Defaults
86,400 seconds (24 hours).
Command Modes
Global configuration
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
Use the ip tcp intercept connection-timeout command to change how long a TCP connection will be managed by the TCP intercept after a period of inactivity.
Examples
The following example sets the software to manage the connection for 12 hours (43,200 seconds) after no activity:
ip tcp intercept connection-timeout 43200
To set the TCP intercept drop mode, use the ip tcp intercept drop-mode command in global configuration mode. Use the no form of this command to restore the default.
ip tcp intercept drop-mode {oldest | random}
Syntax Description
oldest Software drops the oldest partial connection. This is the default. random Software drops a randomly selected partial connection.
Defaults
oldest
Command Modes
Global configuration
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
If the number of incomplete connections exceeds 1100 or the number of connections arriving in the last 1 minute exceeds 1100, the TCP intercept feature becomes more aggressive. When this happens, each new arriving connection causes the oldest partial connection to be deleted, and the initial retransmission timeout is reduced by half to 0.5 seconds (and so the total time trying to establish the connection will be cut in half).
Note that the 1100 thresholds can be configured with the ip tcp intercept max-incomplete high and
ip tcp intercept one-minute high commands.
Use the ip tcp intercept drop-mode command to change the dropping strategy from oldest to a random drop.
Examples
The following example sets the drop mode to random:
ip tcp intercept drop-mode random
Related Commands
Defines the maximum number of incomplete connections allowed before the software enters aggressive mode. Defines the number of incomplete connections below which the software leaves aggressive mode. Defines the number of connection requests received in the last one-minutes sample period before the software enters aggressive mode. Defines the number of connection requests below which the software leaves aggressive mode.
Command
Description
To change how long after receipt of a reset or FIN-exchange the software ceases to manage the connection, use the ip tcp intercept finrst-timeout command in global configuration mode. Use the no form of this command to restore the default.
ip tcp intercept finrst-timeout seconds
Syntax Description
seconds Time (in seconds) after receiving a reset or FIN-exchange that the software ceases to manage the connection. The minimum value is 1 second. The default is 5 seconds.
Defaults
5 seconds.
Command Modes
Global configuration
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
Even after the two ends of the connection are joined, the software intercepts packets being sent back and forth. Use this command if you need to adjust how soon after receiving a reset or FIN-exchange the software stops intercepting packets.
Examples
The following example sets the software to wait for 10 seconds before it leaves intercept mode:
ip tcp intercept finrst-timeout 10
To enable TCP intercept, use the ip tcp intercept list command in global configuration mode. Use the no form of this command to disable TCP intercept.
ip tcp intercept list access-list-number
Syntax Description
access-list-number Extended access list number in the range 100 to 199.
Defaults
Disabled
Command Modes
Global configuration
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
The TCP intercept feature intercepts TCP connection attempts and shields servers from TCP SYN-flood attacks, also known as denial-of-service attacks.
TCP packets matching the access list are presented to the TCP intercept code for processing, as determined by the ip tcp intercept mode command. The TCP intercept code either intercepts or watches the connections.
To have all TCP connection attempts submitted to the TCP intercept code, have the access list match everything.
Examples
The following example configuration defines access list 101, causing the software to intercept packets for all TCP servers on the 192.168.1.0/24 subnet:
ip tcp intercept list 101 ! access-list 101 permit tcp any 192.168.1.0 0.0.0.255
Related Commands
access-list (IP extended) Defines an extended IP access list. Changes the TCP intercept mode. Displays TCP incomplete and established connections. Displays TCP intercept statistics.
Command
Description
To define the maximum number of incomplete connections allowed before the software enters aggressive mode, use the ip tcp intercept max-incomplete high command in global configuration mode. Use the no form of this command to restore the default.
ip tcp intercept max-incomplete high number
Syntax Description
number Defines the number of incomplete connections allowed, above which the software enters aggressive mode. The range is 1 to 2147483647. The default is 1100.
Defaults
1100 incomplete connections.
Command Modes
Global configuration
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
If the number of incomplete connections exceeds the number configured, the TCP intercept feature becomes aggressive. The following are the characteristics of aggressive mode:
You can change the drop strategy from the oldest connection to a random connection with the
ip tcp intercept drop-mode command.
![]() |
Note The two factors that determine aggressive mode (connection requests and incomplete connections) are related and work together. When the value of either ip tcp intercept one-minute high or ip tcp intercept max-incomplete high is exceeded, aggressive mode begins. When both connection requests and incomplete connections fall below the values of ip tcp intercept one-minute low and ip tcp intercept max-incomplete low, aggressive mode ends. |
The software will back off from its aggressive mode when the number of incomplete connections falls below the number specified by the ip tcp intercept max-incomplete low command.
Examples
The following example allows 1500 incomplete connections before the software enters aggressive mode:
ip tcp intercept max-incomplete high 1500
Related Commands
Sets the TCP intercept drop mode. Defines the number of incomplete connections below which the software leaves aggressive mode. Defines the number of connection requests received in the last one-minutes sample period before the software enters aggressive mode. Defines the number of connection requests below which the software leaves aggressive mode.
Command
Description
To define the number of incomplete connections below which the software leaves aggressive mode, use the ip tcp intercept max-incomplete low command in global configuration mode. Use the no form of this command to restore the default.
ip tcp intercept max-incomplete low number
Syntax Description
number Defines the number of incomplete connections below which the software leaves aggressive mode. The range is 1 to 2147483647. The default is 900.
Defaults
900 incomplete connections.
Command Modes
Global configuration
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
When both connection requests and incomplete connections fall below the values of ip tcp intercept one-minute low and ip tcp intercept max-incomplete low, the TCP intercept feature leaves aggressive mode.
![]() |
Note The two factors that determine aggressive mode (connection requests and incomplete connections) are related and work together. When the value of either ip tcp intercept one-minute high or ip tcp intercept max-incomplete high is exceeded, aggressive mode begins. When both connection requests and incomplete connections fall below the values of ip tcp intercept one-minute low and ip tcp intercept max-incomplete low, aggressive mode ends. |
See the ip tcp intercept max-incomplete high command for a description of aggressive mode.
Examples
The following example sets the software to leave aggressive mode when the number of incomplete connections falls below 1000:
ip tcp intercept max-incomplete low 1000
Related Commands
Sets the TCP intercept drop mode. Defines the maximum number of incomplete connections allowed before the software enters aggressive mode. Defines the number of connection requests received in the last one-minutes sample period before the software enters aggressive mode. Defines the number of connection requests below which the software leaves aggressive mode.
Command
Description
To change the TCP intercept mode, use the ip tcp intercept mode command in global configuration mode. Use the no form of this command to restore the default.
ip tcp intercept mode {intercept | watch}
Syntax Description
intercept Active mode in which the TCP intercept software intercepts TCP packets from clients to servers that match the configured access list and performs intercept duties. This is the default. watch Monitoring mode in which the software allows connection attempts to pass through the router and watches them until they are established.
Defaults
intercept
Command Modes
Global configuration
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
When TCP intercept is enabled, it operates in intercept mode by default. In intercept mode, the software actively intercepts TCP SYN packets from clients to servers that match the specified access list. For each SYN, the software responds on behalf of the server with an ACK and SYN, and waits for an ACK of the SYN from the client. When that ACK is received, the original SYN is sent to the server, and the code then performs a three-way handshake with the server. Then the two half-connections are joined.
In watch mode, the software allows connection attempts to pass through the router, but watches them until they become established. If they fail to become established in 30 seconds (or the value set by the ip tcp intercept watch-timeout command), a Reset is sent to the server to clear its state.
Examples
The following example sets the mode to watch mode:
ip tcp intercept mode watch
Related Commands
Defines how long the software will wait for a watched TCP intercept connection to reach established state before sending a reset to the server.
Command
Description
To define the number of connection requests received in the last one-minutes sample period before the software enters aggressive mode, use the ip tcp intercept one-minute high command in global configuration mode. Use the no form of this command to restore the default.
ip tcp intercept one-minute high number
Syntax Description
number Specifies the number of connection requests that can be received in the last one-minute sample period before the software enters aggressive mode. The range is 1 to 2147483647. The default is 1100.
Defaults
1100 connection requests.
Command Modes
Global configuration
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
If the number of connection requests exceeds the number value configured, the TCP intercept feature becomes aggressive. The following are the characteristics of aggressive mode:
You can change the drop strategy from the oldest connection to a random connection with the ip tcp intercept drop-mode command.
![]() |
Note The two factors that determine aggressive mode (connection requests and incomplete connections) are related and work together. When the value of either ip tcp intercept one-minute high or ip tcp intercept max-incomplete high is exceeded, aggressive mode begins. When both connection requests and incomplete connections fall below the values of ip tcp intercept one-minute low and ip tcp intercept max-incomplete low, aggressive mode ends. |
Examples
The following example allows 1400 connection requests before the software enters aggressive mode:
ip tcp intercept one-minute high 1400
Related Commands
Sets the TCP intercept drop mode. Defines the maximum number of incomplete connections allowed before the software enters aggressive mode. Defines the number of incomplete connections below which the software leaves aggressive mode. Defines the number of connection requests below which the software leaves aggressive mode.
Command
Description
To define the number of connection requests below which the software leaves aggressive mode, use the ip tcp intercept one-minute low command in global configuration mode. Use the no form of this command to restore the default.
ip tcp intercept one-minute low number
Syntax Description
number Defines the number of connection requests in the last one-minute sample period below which the software leaves aggressive mode. The range is 1 to 2147483647. The default is 900.
Defaults
900 connection requests.
Command Modes
Global configuration
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
When both connection requests and incomplete connections fall below the values of ip tcp intercept one-minute low and ip tcp intercept max-incomplete low, the TCP intercept feature leaves aggressive mode.
![]() |
Note The two factors that determine aggressive mode (connection requests and incomplete connections) are related and work together. When the value of either ip tcp intercept one-minute high or ip tcp intercept max-incomplete high is exceeded, aggressive mode begins. When both connection requests and incomplete connections fall below the values of ip tcp intercept one-minute low and ip tcp intercept max-incomplete low, aggressive mode ends. |
See the ip tcp intercept one-minute high command for a description of aggressive mode.
Examples
The following example sets the software to leave aggressive mode when the number of connection requests falls below 1000:
ip tcp intercept one-minute low 1000
Related Commands
Sets the TCP intercept drop mode. Defines the maximum number of incomplete connections allowed before the software enters aggressive mode. Defines the number of incomplete connections below which the software leaves aggressive mode. Defines the number of connection requests received in the last one-minutes sample period before the software enters aggressive mode.
Command
Description
To define how long the software will wait for a watched TCP intercept connection to reach established state before sending a reset to the server, use the ip tcp intercept watch-timeout command in global configuration mode. Use the no form of this command to restore the default.
ip tcp intercept watch-timeout seconds
Syntax Description
seconds Time (in seconds) that the software waits for a watched connection to reach established state before sending a Reset to the server. The minimum value is 1 second. The default is 30 seconds.
Defaults
30 seconds.
Command Modes
Global configuration
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
Use this command if you have set the TCP intercept to passive watch mode and you want to change the default time the connection is watched. During aggressive mode, the watch timeout time is cut in half.
Examples
The following example sets the software to wait 60 seconds for a watched connection to reach established state before sending a Reset to the server:
ip tcp intercept watch-timeout 60
Related Commands
Changes the TCP intercept mode.
Command
Description
To display TCP incomplete and established connections, use the show tcp intercept connections command in EXEC mode.
show tcp intercept connectionsSyntax Description
This command has no arguments or keywords.
Command Modes
EXEC
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
Use the show tcp intercept connections command to display TCP incomplete and established connections.
Examples
The following is sample output from the show tcp intercept connections command:
Router# show tcp intercept connections
Incomplete:
Client Server State Create Timeout Mode
172.19.160.17:58190 10.1.1.30:23 SYNRCVD 00:00:09 00:00:05 I
172.19.160.17:57934 10.1.1.30:23 SYNRCVD 00:00:09 00:00:05 I
Established:
Client Server State Create Timeout Mode
171.69.232.23:1045 10.1.1.30:23 ESTAB 00:00:08 23:59:54 I
Table 14 describes significant fields shown in the display.
| Field | Description |
|---|---|
Incomplete: | Rows of information under "Incomplete" indicate connections that are not yet established. |
Client | IP address and port of the client. |
Server | IP address and port of the server being protected by TCP intercept. |
State | SYNRCVD---establishing with client. SYNSENT---establishing with server. ESTAB---established with both, passing data. |
Create | Hours:minutes:seconds since the connection was created. |
Timeout | Hours:minutes:seconds until the retransmission timeout. |
Mode | I---intercept mode. W---watch mode. |
Established: | Rows of information under "Established" indicate connections that are established. The fields are the same as those under "Incomplete" except for the Timeout field described below. |
Timeout | Hours:minutes:seconds until the connection will timeout, unless the software sees a FIN exchange, in which case this indicates the hours:minutes:seconds until the FIN or RESET timeout. |
Related Commands
Changes how long a TCP connection will be managed by the TCP intercept after no activity. Changes how long after receipt of a reset or FIN-exchange the software ceases to manage the connection. Enables TCP intercept. Displays TCP intercept statistics.
Command
Description
To display TCP intercept statistics, use the show tcp intercept statistics command in EXEC mode.
show tcp intercept statisticsSyntax Description
This command has no arguments or keywords.
Command Modes
EXEC
Command History
11.2 F This command was introduced.
Release
Modification
Usage Guidelines
Use the show tcp intercept statistics command to display TCP intercept statistics.
Examples
The following is sample output from the show tcp intercept statistics command:
Router# show tcp intercept statistics intercepting new connections using access-list 101 2 incomplete, 1 established connections (total 3) 1 minute connection request rate 2 requests/sec
Related Commands
Changes how long a TCP connection will be managed by the TCP intercept after no activity. Changes how long after receipt of a reset or FIN-exchange the software ceases to manage the connection. Enables TCP intercept. Displays TCP incomplete and established connections.
Command
Description
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Tue Apr 4 17:38:05 PDT 2000
Copyright 1989 - 2000©Cisco Systems Inc.