Telnet is a basic command in the networking world to setup a TCP session to a service on a remote host. It completes the TCP handshake (SYN, SYN/ACK, ACK) so it can be used to emulate the setup of an TCP session expected to be optimized.
Once telnet has successfully setup its TCP session, the only way to
get out of it is to either let the server terminate the TCP session
(protocol timeout, protocol error, issuing the command to terminate
the TCP session) or to press the
control-]
and to type
quit
command in the
telnet>
prompt.
Using the telnet client available under Microsoft Windows, the screen will be cleared when the TCP session is setup.
With the introduction of Microsoft Windows 7, the telnet client is not installed by default anymore. You can install it via Control Panel -> Programs and Features -> Enable Features and install the Telnet Client from there.
The reason the command-line telnet application should be used and not an integrated telnet client like in PuTTY or in SecureCRT is that they are very time-wasting to setup and hide information from you. For example you will have to enter the connection details in a dialog box, you will get dialog box on the screen which shows that a failure happened and you will not see that a TCP session has setup successfully until you get text send back to you. The telnet application on the command-line has an easy way to enter the session details, it will be clear when the TCP session has been setup, has an easy way to terminate the session and is clear when the TCP session has been terminated.
The telnet command available on the Steelhead appliance supports both IPv4 and IPv6 destinations, but it is not possible to explicitly choose for an IPv4 or IPv6 address when using a hostname to connect to.
The following options are available for the telnet command:
The option
-b <IP address>
binds the source IPv4 or IPv6 address of TCP session to the
destination IP address.
The telnet command uses by default the IP address of the primary interface:
Figure 3.42. Successful TCP session setup via the primary interface
SH # telnet 192.168.1.1 139 Trying 192.168.1.1... Connected to 192.168.1.1. Escape character is '^]'
In this case the TCP session is setup between the hosts 10.0.1.5 and 192.168.1.1 on destination TCP port 139.
The
-b
option can be used to specify the IP address of the in-path interface.
Figure 3.43. Successful TCP session setup via the in-path interface
SH # telnet -b 10.0.1.6 192.168.1.1 139 Trying 192.168.1.1... Connected to 192.168.1.1. Escape character is '^]'
In this case the TCP session is setup between the hosts 10.0.1.6 and 192.168.1.1.
A No route to host error is shown when the remote host does not exist and the router on that subnet sends back an ICMP Host Unreachable message or when the a router in the network doesn't know where to forward the IP packet to and sends an ICMP Network Unreachable message to the client.
Figure 3.44. Telnet attempt to a host which does not exist
SH # telnet 192.168.1.1 139 Trying 192.168.1.1... telnet: connect to address 192.168.1.1: No route to host
This happens when no TCP SYN/ACK is received on the three TCP SYN packets send out by the client.
Figure 3.45. Telnet attempt to a host which does not exist
SH # telnet 192.168.1.1 139 Trying 192.168.1.1... telnet: connect to address 192.168.1.1: Connection timed out
This happens when the TCP SYN packet is delivered to the remote host but when there is no service listening on that TCP port.
Figure 3.46. Telnet attempt to a host with no service listening on port 139
SH # telnet 192.168.1.1 139 Trying 192.168.1.1... telnet: connect to address 192.168.1.1: Connection refused