enable 退出特權模式命令:Switch#exit 啟用命令查詢:? 時間設置:S " />
2024年3月18日發(作者:時間飛了)

-----WORD格式--可編輯--專業資料-----
思科交換機常用命令大全
1.1 用戶模式與特權模式
用戶模式:可以使用一些基本的查詢命令
特權模式:可以對交換機進行相關的配置
進入特權模式命令:Switch>enable
退出特權模式命令:Switch#exit
啟用命令查詢:?
時間設置:Switch#clock t
時間(自選參數,參數必須符合交換機要求)
顯示信息命令:Switch#show
可選參數
注意:可以用TAB鍵補齊命令,自選參數為用戶自定義參數,可選參數為交換機設定參數
查看交換機配置: Switch#show running-config
保存交換機配置:Switch#copy running-config startup-config
Switch#wr
--完整版學習資料分享----
-----WORD格式--可編輯--專業資料-----
查看端口信息:Switch#show interface
查看MAC地址表:Switch#show mac-address-table
查看交換機CPU的狀態信息:Switch#show process
1.2 全局配置模式
進入全局配置模式:Switch#configure terminal
主機名修改:Switch(config)#hostname
主機名(自選參數)
特權模式進入密碼: Switch(config)#enable cret
密碼(自選參數)
取消特權模式密碼:Switch(config)#no enable cret
取消主機名設置: Switch(config)#no hostname
退出配置模式: Switch(config)#exit
需要特別注意的是在配置模式中無法使用show命令,如果要使用
的話show前必須加do和空格,例如:do show *
指定根交換機命令:Switch(config)#spanning-tree vlan
自選參數(VLAN號)
primary
--完整版學習資料分享----
root
-----WORD格式--可編輯--專業資料-----
例如: 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
可選參數
--完整版學習資料分享----
-----WORD格式--可編輯--專業資料-----
雙工模式: 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 databa
Switch(vlan)#no vlan
自選參數(vlan號)
例如:Switch#vlan databa
Switch(vlan)#no vlan 2
將一個接口加入VLAN:
--完整版學習資料分享----
-----WORD格式--可編輯--專業資料-----
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
例如:Switch(config)#interface f0/1
--完整版學習資料分享----
VLAN號) 自選參數(
-----WORD格式--可編輯--專業資料-----
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)
--完整版學習資料分享----
-----WORD格式--可編輯--專業資料-----
例如: 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)#ip 255.255.255.0
Switch(config-if)#no shutdown
--完整版學習資料分享----
-----WORD格式--可編輯--專業資料-----
注意:IP地址必須與遠程連接交換機的PC機地址在同一網段
在交換機上指定默認網關:
Switch(config)#ip default-gateway
注意:指定的默認網關僅當前交換機有效。
將交換機連接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 cret
自選參數
--完整版學習資料分享----
本文發布于:2024-03-18 13:38:39,感謝您對本站的認可!
本文鏈接:http://www.newhan.cn/zhishi/a/1710740319164911.html
版權聲明:本站內容均來自互聯網,僅供演示用,請勿用于商業和其他非法用途。如果侵犯了您的權益請與我們聯系,我們將在24小時內刪除。
本文word下載地址:(完整版)思科交換機命令大全.doc
本文 PDF 下載地址:(完整版)思科交換機命令大全.pdf
| 留言與評論(共有 0 條評論) |