思科基础知识:管理Cisco互联网络(5)

网络
本文主要向大家介绍了备份和恢复Cisco IOS;备份和恢复Cisco配置;通过CDP和Telnet收集相邻设备的相关信息;解析主机名;使用ping和traceroute命令测试网络连接。

Cisco互联网络—收集借口流量信息

使用show cdp traffic命令显示接口CDP包流量信息,如下:

  1. Router#sh cdp traffic  
  2.  
  3. CDP counters:  
  4.  
  5. Packets output: 13, Input: 8  
  6.  
  7. Hdr syntax: 0, Chksum error: 0, Encaps failed: 0  
  8.  
  9. No memory: 0, Invalid packet: 0, Fragmented: 0  
  10.  
  11. Router# 

Cisco互联网络—收集端口和接口信息

使用show cdp interface命令显示接口的CDP状态信息

Cisco互联网络—使用Telnet

在特权模式下使用telnet [IP地址]的命令进行telnet,如下:

  1. Router#telnet 172.16.10.2  
  2.  
  3. Trying 172.16.10.2 … Open  
  4.  
  5. Password required, but none set  
  6.  
  7. [Connection to 172.16.10.2 closed by foreign host]  
  8.  
  9. Router# 

由上面提示可以看出,VTY没有密码配置的话是不允许你telnet的(除非你使用了no login命令,但是安全性几乎为0).所以在telnet前,记得先给目标设备的VTY线路配置密码

Cisco互联网络—同时Telnet到多个设备

当你telnet到远程设备的时候,可以在任何情况下使用exit命令来终止连接.但是假如你想保持这个连接,同时又对另外1个设备进行telnet的时候,使用Ctrl+Shift+6,再按下X键,就可以回到本地console,再对另外1设备进行telnet.如下:

  1. 2500#telnet 172.16.10.2  
  2.  
  3. Trying 172.16.10.2 … Open  
  4.  
  5. User Access Verification  
  6.  
  7. Password:  
  8.  
  9. 2600>[Ctrl+Shift+6,X]  
  10.  
  11. 2500#telnet 192.168.0.32  
  12.  
  13. (略) 

Cisco互联网络—检查Telnet连接

查看从本地到远程的连接会话,使用show sessions命令,如下:

  1. 2500#sh sessions  
  2.  
  3. Conn Host Address Byte Idle Conn Name  
  4.  
  5. 1 172.16.10.2 172.16.10.2 0 0 172.16.10.2  
  6.  
  7. *2 192.168.0.32 192.168.0.32 0 0 192.168.0.32  
  8.  
  9. 2500# 

注意*所在的会话代表你的最后1个会话,可以直接敲2下Enter键回到*号会话,也可以输入前面的数字,再敲2下Enter键回到相应会话

Cisco互联网络—检查Telnet用户

使用show users命令列举本地所有活动console和VTY端口,如下:

  1. 2500#sh users  
  2.  
  3. Line User Host(s) Idle Location  
  4.  
  5. * 0 con 0 172.16.10.2 00:07:52  
  6.  
  7. 192.168.0.32 00:07:18 

注意上面输出的con代表本地console,这个例子可以看到从本地console连接了远程的2个设备.接下来在我们远程设备上使用这个命令,如下:

  1. 2600>sh users  
  2.  
  3. Line User Host(s) Idle Location  
  4.  
  5. 0 con 0 idle 9  
  6.  
  7. *2 vty 0 

这个输出内容可以看出console是活动的,而且VTY端口2被使用

Cisco互联网络—关闭Telnet会话

之前说过,要终止telnet会话,在远程(被telnet)设备上使用exit命令.但是要从本地设备终止会话的话,就需要在本地使用disconnect命令,如下:

  1. 2500#disconnect ?  
  2.  
  3. <1-2> The number of an active network connection  
  4.  
  5. WORD The name of an active network connection  
  6.  
  7. <cr> 
  8.  
  9. 2500#disconnect 1  
  10.  
  11. Closing connection to 172.16.10.2 [confirm]  
  12.  
  13. 2500# 

验证如下:

  1. 2600#sh users  
  2.  
  3. Line User Host(s) Idle Location  
  4.  
  5. *0 con 0 idle 0  
  6.  
  7. 1 aux 0 idle 0  
  8.  
  9. 2 vty 0 idle 172.16.10.1 

清除连接,使用clear line命令,并验证,如下:

  1. 2600#clear line 2  
  2.  
  3. [confirm]  
  4.  
  5. [OK]  
  6.  
  7. 2600#sh users  
  8.  
  9. Line User Host(s) Idle Location  
  10.  
  11. *0 con 0 idle 0  
  12.  
  13. 1 aux 0 idle 1  
  14.  
  15. 2600# 

【编辑推荐】

  1. 思科基础知识:管理Cisco互联网络(1)
  2. 思科基础知识:管理Cisco互联网络(2)
  3. 思科基础知识:管理Cisco互联网络(3)
  4. 思科基础知识:管理Cisco互联网络(4)
  5. 思科基础知识:管理Cisco互联网络(6)
责任编辑:佚名 来源: 51CTO整理
相关推荐

2011-06-01 14:17:39

Cisco路由器

2011-06-01 14:17:36

CiscoCDP

2011-06-01 13:51:11

Cisco路由器寄存器

2011-06-01 14:17:43

Cisco路由器

2011-06-01 14:17:32

CiscoDNS

2011-05-31 13:52:22

口令CiscoIOS

2010-08-26 13:46:30

2010-03-19 09:52:13

无线互联网

2011-05-31 13:50:17

CiscoIOS

2011-05-31 13:50:14

CiscoIOS

2011-05-31 13:15:03

路由器CiscoIOS

2011-05-31 13:15:05

路由器IOSCisco

2011-05-31 13:50:11

路由器CiscoIOS

2011-05-31 10:14:28

协议IP网络地址

2009-11-06 15:01:30

2011-08-10 13:37:32

分组光纤数据中心数据中心网络

2011-06-01 09:26:55

路由路由器IGRP

2021-07-27 17:43:23

曙光

2020-09-18 06:40:41

IPv6网络方式

2011-01-19 11:46:05

点赞
收藏

51CTO技术栈公众号