" Â The remote system refused the connection."Â
error message presenting on the SSH client such as SecureCRT. Â No matter how you tried from Internal or External interface, it is always same. Is there any configuration wrong? If yes, why did it work at last time?
Symptoms:Â
Through console port, there were some of interesting things:
Router1#show connectionÂ
ID  Name   Â
   Segment 1      Â
 Segment 2        Â
 State  Â
================================================================================
Router1#show users
  Line  Â
 User    Host(s)     Â
  Idle    Location
* Â 1 aux 0 Â Â user2
   idle       Â
 00:00:00  Â
 132 vty 0   user1
 100.9.1.1        48w0d
10.94.200.28
 133 vty 1   user1
 100.9.1.1        48w0d 10.94.200.28
 134 vty 2   user1
 100.9.1.1        48w0d
10.94.200.28
 135 vty 3   user1
 100.9.1.1        48w0d
10.94.200.28
 136 vty 4   user1
 100.9.1.1        47w6d
10.94.200.28
 137 vty 5   user1
 100.9.1.1        47w6d
10.94.200.28
 138 vty 6   user1
 100.9.1.1        47w6d
10.94.200.28
 139 vty 7   user1
 100.9.1.1        47w1d
10.94.200.28
 140 vty 8   user1
 100.9.1.1        47w1d
10.94.200.28
 141 vty 9   user1
 100.9.1.1        46w5d
10.94.200.28
 142 vty 10   user1
 100.9.1.1        43w5d
10.94.200.28
 143 vty 11   user1
 100.9.1.1        43w4d
10.94.200.28
 144 vty 12   user1
 100.9.1.1        41w6d
10.94.200.28
 145 vty 13   user1
 100.9.1.1        41w6d
10.94.200.28
 146 vty 14   user1
 100.9.1.1        41w6d
10.94.200.28
 147 vty 15   user1
 100.9.1.1        41w6d
10.94.200.28
 Interface   User
       Mode   Â
 Idle   Peer Address
Router1#show sshÂ
Connection Version Mode Encryption
 Hmac     State     Â
   Username
0 Â Â Â Â
 2.0   IN  aes256-cbc  hmac-sha1 Â
 Session started    user1
0 Â Â Â Â
 2.0   OUT  aes256-cbc  hmac-sha1 Â
 Session started    user1
1 Â Â Â Â
 2.0   IN  aes256-cbc  hmac-sha1 Â
 Session started    user1
1 Â Â Â Â
 2.0   OUT  aes256-cbc  hmac-sha1 Â
 Session started    user1
2 Â Â Â Â
 2.0   IN  aes256-cbc  hmac-sha1 Â
 Session started    user1
2 Â Â Â Â
 2.0   OUT  aes256-cbc  hmac-sha1 Â
 Session started    user1
3 Â Â Â Â
 2.0   IN  aes256-cbc  hmac-sha1 Â
 Session started    user2
3 Â Â Â Â
 2.0   OUT  aes256-cbc  hmac-sha1 Â
 Session started    user2
4 Â Â Â Â
 2.0   IN  aes256-cbc  hmac-sha1 Â
 Session started    user2
4 Â Â Â Â
 2.0   OUT  aes256-cbc  hmac-sha1 Â
 Session started    user2
5 Â Â Â Â
 2.0   IN  aes256-cbc  hmac-sha1 Â
 Session started    user1
5 Â Â Â Â
 2.0   OUT  aes256-cbc  hmac-sha1 Â
 Session started    user1
6 Â Â Â Â
 2.0   IN  aes256-cbc  hmac-sha1 Â
 Session started    user1
6 Â Â Â Â
 2.0   OUT  aes256-cbc  hmac-sha1 Â
 Session started    user1
7 Â Â Â Â
 2.0   IN  aes256-cbc  hmac-sha1 Â
 Session started    user1
7 Â Â Â Â
 2.0   OUT  aes256-cbc  hmac-sha1 Â
 Session started    user1
8 Â Â Â Â
 2.0   IN  aes256-cbc  hmac-sha1 Â
 Session started    user1
8 Â Â Â Â
 2.0   OUT  aes256-cbc  hmac-sha1 Â
 Session started    user1
9 Â Â Â Â
 2.0   IN  aes256-cbc  hmac-sha1 Â
 Session started    user1
9 Â Â Â Â
 2.0   OUT  aes256-cbc  hmac-sha1 Â
 Session started    user1
10 Â Â Â Â 2.0
  IN  aes256-cbc  hmac-sha1   Session started
   user1
10 Â Â Â Â 2.0
  OUT  aes256-cbc  hmac-sha1   Session started
   user1
11 Â Â Â Â 2.0
  IN  aes256-cbc  hmac-sha1   Session started
   user1
11 Â Â Â Â 2.0
  OUT  aes256-cbc  hmac-sha1   Session started
   user1
12 Â Â Â Â 2.0
  IN  aes256-cbc  hmac-sha1   Session started
   user1
12 Â Â Â Â 2.0
  OUT  aes256-cbc  hmac-sha1   Session started
   user1
13 Â Â Â Â 2.0
  IN  aes256-cbc  hmac-sha1   Session started
   user1
13 Â Â Â Â 2.0
  OUT  aes256-cbc  hmac-sha1   Session started
   user1
14 Â Â Â Â 2.0
  IN  aes256-cbc  hmac-sha1   Session started
   user1
14 Â Â Â Â 2.0
  OUT  aes256-cbc  hmac-sha1   Session started
   user1
15 Â Â Â Â 2.0
  IN  aes256-cbc  hmac-sha1   Session started
   user1
15 Â Â Â Â 2.0
  OUT  aes256-cbc  hmac-sha1   Session started
   user1
%No SSHv1 server connections
running.
Router1#show line
  Tty Line Typ Â
 Tx/Rx   A Modem  Roty AccO AccI  Uses  Noise
Overruns  Int
* Â Â 0 Â Â 0
CTY Â Â Â Â Â Â Â - Â Â - Â
  -   -   -   2  Â
 1   0/0    -
   1 Â
 1 AUX  9600/9600  -   -    -
  -   -   0    0 Â
 0/0    -
   2 Â
 2 TTY  9600/9600  -   -    -
  -   -   9    0 Â
 0/0    -
* Â 132 Â 132 VTY Â
      -   -    -
  -  101   14    0   0/0
   -
* Â 133 Â 133 VTY Â
      -   -    -
  -  101   10    0   0/0
   -
* Â 134 Â 134 VTY Â
      -   -    -
  -  101   5    0   0/0
   -
* Â 135 Â 135 VTY Â
      -   -    -
  -  101   4    0   0/0
   -
* Â 136 Â 136 VTY Â
      -   -    -
  -  101   2    0   0/0
   -
* Â 137 Â 137 VTY Â
      -   -    -
  -  101   8    0   0/0
   -
* Â 138 Â 138 VTY Â
      -   -    -
  -  101   14    0   0/0
   -
* Â 139 Â 139 VTY Â
      -   -    -
  -  101   5    0   0/0
   -
* Â 140 Â 140 VTY Â
      -   -    -
  -  101   4    0   0/0
   -
* Â 141 Â 141 VTY Â
      -   -    -
  -  101   2    0   0/0
   -
* Â 142 Â 142 VTY Â
      -   -    -
  -  101   4    0   0/0
   -
* Â 143 Â 143 VTY Â
      -   -    -
  -  101   2    0   0/0
   -
* Â 144 Â 144 VTY Â
      -   -    -
  -  101   2    0   0/0
   -
* Â 145 Â 145 VTY Â
      -   -    -
  -  101   2    0   0/0
   -
* Â 146 Â 146 VTY Â
      -   -    -
  -  101   2    0   0/0
   -
* Â 147 Â 147 VTY Â
      -   -    -
  -  101   10    0   0/0
   -
Line(s) not in async mode -or- with
no hardware support:Â
3-131
Router1#show tcp brief | i \.22_
319FCE3C Â 100.9.1.5.22 Â
       10.9.200.28.1903  Â
   ESTAB
2901D1E8 Â 100.9.1.2.22 Â
       10.9.200.28.2526  Â
   FINWAIT1
301631E4 Â 100.9.1.2.22 Â
       10.9.200.28.2486  Â
   ESTAB
29353A80 Â 100.9.1.5.22 Â
       10.9.200.28.2735  Â
   ESTAB
28F53880 Â 100.9.1.5.22 Â
       10.9.200.28.4035  Â
   ESTAB
293533DC Â 100.9.1.5.22 Â
       10.9.200.28.2293  Â
   ESTAB
28F408FC Â 100.9.1.2.22 Â
       10.9.200.28.3871  Â
   ESTAB
2933B460 Â 100.9.1.2.22 Â
       10.9.200.14.8725  Â
   ESTAB
28F60DC8 Â 100.9.1.5.22 Â
       10.9.200.28.2365  Â
   ESTAB
315D3BC0 Â 100.9.1.5.22 Â
       10.9.200.28.2819  Â
   ESTAB
2934BD88 Â 100.9.1.2.22 Â
       10.9.200.28.3128  Â
   ESTAB
31904740 Â 100.9.1.2.22 Â
       10.9.200.14.8692  Â
   ESTAB
2901C298 Â 100.9.1.5.22 Â
       10.9.200.28.3874  Â
   ESTAB
315D4264 Â 100.9.1.5.22 Â
       10.9.200.28.3629  Â
   ESTAB
3151B7A4 Â 100.9.1.2.22 Â
       10.9.200.28.2639  Â
   FINWAIT1
It seems all VTY lines have been used and for somehow system did not end those idle sessions although exec-timeout has been set.
Solution:Â
1. Clear lineÂ
Router2#clear line vty 0
[confirm]
 [OK]
2. Set ssh time-out
ip ssh time-out 30
3. set absolute-timeout
line vty 0 15
absolute-timeout 15
4. Using service tcp-keepalives to Avoid Hung Telnet Sessions
http://www.cisco.com/en/US/tech/tk801/tk36/technologies_tech_note09186a00801365f3.shtml"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."
Router1# config term
Router1(config)# service tcp-keepalives-in
Router1(config)# service tcp-keepalives-out
Router1(config)# end
Hey very nice blog!I’m an instant fan, I have bookmarked you and I’ll be checking back on a regular.See u.
ReplyDeletePgp encryption