CISCO R&S 的常用命令
 
------------------------------------------------------------------
1】  Switch 命令
(1)交换机的运行模式
用户模式; Switch >  //只能简单进行查看信息
特权模式 Switch #  //show命令运行在此模式下,do show在配置模式下
配置模式 Switch (config)#   //配置整个交换机
端口模式 Switch (config-if)#  //配置具体的端口和 Vlan1作管理
 
(2)改变命令的状态
进入特权命令状态 enable
退出特权命令态         exit;disable
进入设置对话状态 setup
进入全局设置状态 config terminal
退出全局设置状态 end / ctrl ^ z
进入端口设置状态 interface type slot/number
进入线路设置状态 line type slot/number
配置console口         Line console 0
配置 vty(虚拟终端) Line vty 0 4
退出局部设置状态 exit

(3)远程管理
设置管理地址:         Interface  vlan1  //默认的管理
                        Ip address  ip 地址  子网掩码
配置console口:         Line console 0
                        Password  密码  //设置密码
                        Login           //登陆
配置 vty (虚拟终端) Line vty 0 4   //最多允许5个远程终端进行管理
                        Password  密码 
                        Login

(4)显示命令
查看版本及引导信息 show version
查看运行设置         show running-config
查看开机设置         show startup-config
显示端口信息         show interface type slot/number
 
(5 )拷贝命令
用于IOS及config的备份和升级
switch#copy flash tftp                 备份IOS       
switch#copy tftp flash                 升级IOS
switch#copy nvram:startup-config tftp: 备份配置文件
switch#copy tftp:startup-config nvram  还原配置文件
 
(6)网络命令
登录远程主机        telnet hostname/IP address
网络侦测        ping hostname/IP address
路由跟踪        trace hostname/IP address
----------------------------------------------------------------
 
2】       Router 命令
(1)基本设置命令
全局设置          config terminal
设置访问用户码          username username password password
设置特权密码          enable secret password
设置路由器名          hostname name
设置静态路由          ip route destination subnet-mask next-hop
启动IPX路由          ipx routing
端口设置          interface type slot/number
设置IP 址          ip address address subnet-mask
设置IP网络          ipx network network
激活端口          no shutdown
物理线路设置          line type number
启动登录进程          login [local|tacacs server]
设置登录密码          password password
进入特权命令状态  enable
退出特权命令状态  exit;disable
进入设置对话状态  setup
进入全局设置状态  config terminal
退出全局设置状态  end / ctrl ^ z
进入端口设置状态  interface type slot/number
进入子端口设置状态  interface type number. Subinter face
                         [point-to-point|multipoint]
进入线路设置状态  line type slot/number
配置console口          Line console 0
配置 vty(虚拟终端)  Line vty 0 4
进入路由设置状态  router protocol
退出局部设置状态  exit
 
(2)显示命令
查看版本及引导信息 show version
查看运行设置         show running-config
查看开机设置         show startup-config
显示端口信息         show interface type slot/number
(3)网络命令
登录远程主机        telnet hostname/IP address
网络侦测        ping hostname/IP address
路由跟踪        trace hostname/IP address
 
(4)拷贝命令
用于IOS及config的备份和升级
router#copy flash tftp                 备份IOS       
router#copy tftp flash                 升级IOS
router#copy nvram:startup-config tftp: 备份配置文件
router#copy tftp:startup-config nvram  还原配置文件
router#copy startup-config running-config   保存配置文件