|
|
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 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 global configuration command. Use the no form of this command to restore the default.
ip tcp intercept connection-timeout seconds
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). |
86,400 seconds (24 hours)
Global configuration
This command first appeared in Cisco IOS Release 11.2 F.
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 global configuration command. Use the no form of this command to restore the default.
ip tcp intercept drop-mode {oldest | random}
oldest | Software drops the oldest partial connection. This is the default. |
random | Software drops a randomly selected partial connection. |
oldest
Global configuration
This command first appeared in Cisco IOS Release 11.2 F.
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.
The following example sets the drop mode to random:
ip tcp intercept drop-mode random
You can use the master indexes or search online to find documentation of related commands.
ip tcp intercept max-incomplete high
ip tcp intercept max-incomplete low
ip tcp intercept one-minute high
ip tcp intercept one-minute low
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 global configuration command. Use the no form of this command to restore the default.
ip tcp intercept finrst-timeout seconds
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. |
5 seconds
Global configuration
This command first appeared in Cisco IOS Release 11.2 F.
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.
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 global configuration command. Use the no form of this command to disable TCP intercept.
ip tcp intercept list access-list-number
access-list-number | Extended access list number in the range 100 to 199. |
Disabled
Global configuration
This command first appeared in Cisco IOS Release 11.2 F.
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.
The following 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
You can use the master indexes or search online to find documentation of related commands.
access-list (extended)
ip tcp intercept mode
show tcp intercept connections
show tcp intercept statistics
To define the maximum number of incomplete connections allowed before the software enters aggressive mode, use the ip tcp intercept max-incomplete high global configuration command. Use the no form of this command to restore the default.
ip tcp intercept max-incomplete high number
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. |
1100 incomplete connections
Global configuration
This command first appeared in Cisco IOS Release 11.2 F.
If the number of incomplete connections exceeds the number configured, the TCP intercept feature becomes aggressive. These 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.
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.
The following example allows 1500 incomplete connections before the software enters aggressive mode:
ip tcp intercept max-incomplete high 1500
You can use the master indexes or search online to find documentation of related commands.
ip tcp intercept drop-mode
ip tcp intercept max-incomplete low
ip tcp intercept one-minute high
ip tcp intercept one-minute low
To define the number of incomplete connections below which the software leaves aggressive mode, use the ip tcp intercept max-incomplete low global configuration command. Use the no form of this command to restore the default.
ip tcp intercept max-incomplete low number
number | Defines the number of incomplete connections below which the software leaves aggressive mode. The range is 1 to 2147483647. The default is 900. |
900 incomplete connections
Global configuration
This command first appeared in Cisco IOS Release 11.2 F.
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.
See the ip tcp intercept max-incomplete high command for a description of aggressive mode.
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
You can use the master indexes or search online to find documentation of related commands.
ip tcp intercept drop-mode
ip tcp intercept max-incomplete high
ip tcp intercept one-minute high
ip tcp intercept one-minute low
To change the TCP intercept mode, use the ip tcp intercept mode global configuration command. Use the no form of this command to restore the default.
ip tcp intercept mode {intercept | watch}
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. |
intercept
Global configuration
This command first appeared in Cisco IOS Release 11.2 F.
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.
The following example sets the mode to watch mode:
ip tcp intercept mode watch
You can use the master indexes or search online to find documentation of related commands.
ip tcp intercept watch-timeout
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 global configuration command. Use the no form of this command to restore the default.
ip tcp intercept one-minute high number
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. |
1100 connection requests
Global configuration
This command first appeared in Cisco IOS Release 11.2 F.
If the number of connection requests exceeds the number value configured, the TCP intercept feature becomes aggressive. These 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.
The following example allows 1400 connection requests before the software enters aggressive mode:
ip tcp intercept one-minute high 1400
You can use the master indexes or search online to find documentation of related commands.
ip tcp intercept drop-mode
ip tcp intercept max-incomplete high
ip tcp intercept max-incomplete low
ip tcp intercept one-minute low
To define the number of connection requests below which the software leaves aggressive mode, use the ip tcp intercept one-minute low global configuration command. Use the no form of this command to restore the default.
ip tcp intercept one-minute low number
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. |
900 connection requests
Global configuration
This command first appeared in Cisco IOS Release 11.2 F.
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.
See the ip tcp intercept one-minute high command for a description of aggressive mode.
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
You can use the master indexes or search online to find documentation of related commands.
ip tcp intercept drop-mode
ip tcp intercept max-incomplete high
ip tcp intercept max-incomplete low
ip tcp intercept one-minute high
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 global configuration command. Use the no form of this command to restore the default.
ip tcp intercept watch-timeout seconds
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. |
30 seconds
Global configuration
This command first appeared in Cisco IOS Release 11.2 F.
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.
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
You can use the master indexes or search online to find documentation of related commands.
To display TCP incomplete and established connections, use the show tcp intercept connections EXEC command.
show tcp intercept connectionsThis command has no arguments or keywords.
EXEC
This command first appeared in Cisco IOS Release 11.2 F.
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 18 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. |
You can use the master indexes or search online to find documentation of related commands.
ip tcp intercept connection-timeout
ip tcp intercept finrst-timeout
ip tcp intercept list
show tcp intercept statistics
To display TCP intercept statistics, use the show tcp intercept statistics EXEC command.
show tcp intercept statisticsThis command has no arguments or keywords.
EXEC
This command first appeared in Cisco IOS Release 11.2 F.
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
You can use the master indexes or search online to find documentation of related commands.
ip tcp intercept connection-timeout
ip tcp intercept finrst-timeout
ip tcp intercept list
show tcp intercept connections
|
|