PDF(73.8 KB) View with Adobe Reader on a variety of devices
ePub(81.9 KB) View in various apps on iPhone, iPad, Android, Sony Reader, or Windows Phone
Mobi (Kindle)(67.4 KB) View on Kindle device or Kindle app on multiple devices
Updated:November 19, 2007
The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This document explains how to use service tcp-keepalives to clear hung
Before You Begin
There are no specific prerequisites for this document.
This document is not restricted to specific software and hardware
The information presented in this document was created from devices in
a specific lab environment. All of the devices used in this document started
with a cleared (default) configuration. If you are working in a live network,
ensure that you understand the potential impact of any command before using
This topology allows for a remote terminal user to gain access to a
server across a network using an autocommand telnet in the configuration of
If, however, Router 2 is reloaded for any reason, the terminal will not
be able to get back into the server. Upon attempting to activate the
connection, the user will see a "Connection refused by remote host" message.
This message appears because the server believes that the previous telnet
session is still connected, thus blocking a new session.
This situation could be remedied by a network administrator by issuing
the clear line command on Router 1, but this
approach has two major shortcomings:
Network administrators may be unavailable to clear the line when
For security reasons, the enable password
command is not likely to be given out to users.
One solution is for Router 1 to clear the TTY line when the connection
to Router 2 is lost for any reason. TCP keepalives can resolve this problem.
Turn on TCP keepalives on both routers so that one router will notice when the
connection to the other router goes away; otherwise, the far end has no way to
know that a reboot or other connection loss has happened. TCP keepalives are
non-configurable on the CLI and the keepalives can be changed through
To enable TCP keepalives on the routers, use the following
Router1# config term
Router1(config)# service tcp-keepalives-in
Router1(config)# service tcp-keepalives-out