Cisco telnet

Pocket

R2 側に必要な設定

enable secret password
line vty 0 15
password password
login
end

接続

R1#telnet 192.168.12.2
Trying 192.168.12.2 ... Open


User Access Verification

Password:
R2>en
Password:
R2#

ユーザ一覧

R1 から telnet してアクセスした場合

R2>show users
    Line       User       Host(s)              Idle       Location
   0 con 0                idle                 00:01:33
* 98 vty 0                idle                 00:00:00 192.168.12.1

  Interface    User               Mode         Idle     Peer Address

GNS3 上でのコンソールアクセスの場合

R2#show users
    Line       User       Host(s)              Idle       Location
*  0 con 0                idle                 00:00:00
  98 vty 0                idle                 00:00:41 192.168.12.1

  Interface    User               Mode         Idle     Peer Address

Exit Session

R2>exit

セッションの再開

[Connection to 192.168.12.2 closed by foreign host]

R1#telnet 192.168.12.2
Trying 192.168.12.2 ... Open


User Access Verification

Password:
R2>en
Password:
R2# ← Ctrl+Shift+6 X(or control+^ X)
R1#

R1#sh sessions
Conn Host                Address             Byte  Idle Conn Name
*  1 192.168.12.2        192.168.12.2           0     0 192.168.12.2

R1#resume 1
[Resuming connection 1 to 192.168.12.2 ... ]

R2#

telnet セッションを切断したい

Ctrl+Shift+6 X

R2# ← Ctrl+Shift+6 X(or control+^ X)
R1#disconnect
Closing connection to 192.168.12.2 [confirm]
R1#sh sessions
% No connections open

R2#sh users
    Line       User       Host(s)              Idle       Location
*  0 con 0                idle                 00:00:00

  Interface    User               Mode         Idle     Peer Address

放置されたセッション、悪意あるセッションを殺す

R1#telnet 192.168.12.2
Trying 192.168.12.2 ... Open


User Access Verification

Password:
R2>en
Password:
R2#

R2#sh users
    Line       User       Host(s)              Idle       Location
*  0 con 0                idle                 00:00:00
  98 vty 0                idle                 00:00:26 192.168.12.1

  Interface    User               Mode         Idle     Peer Address

駆逐してやる!

R2#clear line 98
[confirm]
 [OK]
R2#sh users
    Line       User       Host(s)              Idle       Location
*  0 con 0                idle                 00:00:00

  Interface    User               Mode         Idle     Peer Address

R1 側では

R2#
[Connection to 192.168.12.2 closed by foreign host]
R1#

実装時や実験環境ではセッションタイムアウトを無効にしていることが多い。

exec-timeout 0 0

References

  1. Ciscoデバイスの操作 – Telnet
  2. WS-C3550でTelnetログインできるようにする | | Beyond Future Yak Shaving
  3. Network Swiss Army Knife | Beyond Future Yak Shaving

One Reply to “Cisco telnet”

Leave a Reply

Your email address will not be published. Required fields are marked *