思科交换机命令大全

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

思科交换机常用命令大全
1.1用户模式与特权模式
用户模式:可以使用一些基本的盘问命令
特权模式:可以对交换机进行相关的配置
进入特权模式命令:Switch>enable
退出特权模式命令:Switch#exit
启用命令盘问:?
时间设置:Switch#clock set时间(自选参数,参数必定吻合交换机要求)显示信息命令: Switch#show 可选参数
注意:可以用 TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数
查察交换机配置 :Switch#show running-config
保存交换机配置:Switch#copy running-config startup-config
Switch#wr
查察端口信息: Switch#show interface
查察 MAC地址表:Switch#show mac-address-table
查察交换机 CPU的状态信息:Switch#show processes
1.2全局配置模式
进入全局配置模式:Switch#configure terminal
精选文库主机名更正:Switch(config)#hostname主机名(自选参数)
特权模式进入密码: Switch(config)#enable secret密码(自选参数)
取消特权模式密码:Switch(config)#no enable secret
取消主机名设置: Switch(config)#no hostname
退出配置模式: Switch(config)#exit
需要特别注意的是在配置模式中无法使用show命令,若是要使用
的话 show 前必定加 do 和空格,比方: do show *
指定根交换机命令:Switch(config)#spanning-tree vlan自选参数(VLAN号)root primary
比方: Switch(config)#spanning-tree vlan 1 root primary
需要注意的是:设置根交换机是基于VLAN的
关闭生成树协议命令:Switch(config)#no spanning-tree vlan 自选参数(VLAN号)比方: Switch(config)#no spanning-tree vlan 1
1.3接口配置模式
进入接口配置模式:Switch(config)#interface端口名称(可选参数)
启用端口:Switch(config-if)#no shutdown
停用端口:Switch(config-if)#shutdown
进入同各种类多端口配置:Switch(config)# interface range fastethernet
0/1-5
进入不同样种类多端口配置:Switch(config)#interface range
fastethernet 0/1-5 ,gigabitethernet 0/1-2
精选文库退出接口配置模式:Switch(config-if)#exit
1.4二层端口的配置
端口速率: Switch(config-if)#speed可选参数
双工模式: Switch(config-if)#duplex可选参数
禁用链路协商: Switch(config-if)#no negotiation auto
启用链路协商: Switch(config-if)#negotiation auto
1.5 VLAN 的配置
新建 VLAN:Switch(config)#vlan自选参数(VLAN号)
Switch(config-vlan)#name自选参数(VLAN名)
比方: Switch(config)#vlan 1
Switch(config-vlan)#name lab1
Switch(config-vlan)#exit
删除 VLAN: Switch#vlan database
Switch(vlan)#no vlan自选参数(vlan号)
比方: Switch#vlan database
Switch(vlan)#no vlan 2
将一个接口加入VLAN:
Switch(config)#interface可选参数(接口号)
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan自选参数(VLAN号)Switch(config-if)#no shutdown
Switch(config-if)#exit
比方: Switch(config)#interface f0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 1
Switch(config-if)#no shutdown
Switch(config-if)#exit
将一个接口退出VLAN:
Switch(config)#interface可选参数(接口号)
Switch(config-if)#no switchport access vlan自选参数(VLAN号)比方: Switch(config)#interface f0/1
Switch(config-if)#no switchport access vlan 2
更正一个接口为端口汇聚模式
Switch(config)#interface可选参数(接口号)
Switch(config-if)#switchport mode trunk
VLAN的考据命令:
Switch#show vlan显示VLAN列表
Switch#show interface switchport查察详尽接口的VLAN成员资格信息
1.6 VTP 的配置
VTP Domain Name( VTP域名)
Switch#configure terminal
Switch(config)#vtp domain自选参数
比方: Switch(config)#vtp domain Lab_Network
VTP mode(VTP模式)
Switch(config)#vtp mode可选参数(Server|Client| Transparent)比方: Switch(config)#vtp mode Server
VTP Pruning (VTP修剪)
Switch(config)#vtp pruning
注意:有的交换机不支持VTP修剪命令
查察 VTP的配置命令:
Switch#show vtp status
显示交换机运行的VTP模式,配置校正号和交换机所属的VTP域Switch#show vtp counters
显示 VTP信息相关的统计数据
1.7远程登录交换机设置
配置管理 VLAN:
Switch(conf)#interface vlan 1
精选文库Switch(config-if)#no shutdown
注意: IP 地址必定与远程连接交换机的PC机地址在同一网段
在交换机上指定默认网关:
注意:指定的默认网关仅当前交换机有效。

将交换机连接PC机的端口加入 VLAN 1
Switch(config)#interface端口号(可选参数)
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 1
Switch(config-if)#no shutdown
配置交换机的远程登录
Switch(config)#line vty 0 4
Switch(config-line)#password自选参数
Switch(config-line)#login
Switch(config)#enable secret自选参数。

相关文档
最新文档