以下是常見的cisco交換機命令,具體內容如下:(it培訓機構選擇黎明網絡)
常見命令一、控制臺口令
switch(config)#line console 0 進入控制臺口
switch(config-line)#login 允許登錄
switch(config-line)#password xx 設置登錄口令
switch#exit 返回命令
常見命令二、基本接口配置
switch(config)#interface f0/1 進入f0/1接口
switch(config-if)#duplex full 配置全雙工模式
switch(config-if)#speed 100 配置速率
switch(config-if)#description to ***** 接口描述
switch(config)#ip domain-name ***.com 設置或名服務器
switch(config)#mac-address-table aging-time 設置mac表超時時間
switch#write 保存配置信息
switch#copy running-config startup-config 保存當前配置nvram
switch#erase startup-config 清除配置文件
常見命令三、交換機口令設置:
(我所針對的都是cisco 的設備而言的,華為的可以跟據手冊來查,配置都是差不多的,這里華子就不多寫華為的設備了,了解的也不是很多)
switch>enable 進入特權模式
switch#config terminal 進入全局配置模式
switch(config)#hostname 設置交換機的主機名
switch(config)#enable secret xxx 設置特權加密口令
switch(config)#enable password xxa 設置特權非密口令
常見命令四、vtp配置
switch(config)#vtp domain 設置vtp域名
switch(config)#vtp password 設置vtp密碼
switch(config)#vtp mode server 設置vtp服務器模式
switch(config)#vtp mode client 設置vtp客戶機模式
switch(config)#vtp mode transparent 設置vtp 透明模式
switch(config)#vtp version 設置vtp版本
switch(config)#vtp pruning 啟用vtp修解
switch(config)#no vtp pruning 關閉vtp修解
注:要想從vtp中減少一臺交換機只需將該交換機vtp 名更改
常見命令五、生成樹stp:
switch(config)#spanning-tree vlan 啟用stp生成樹(基于vlan)
switch(config)#spanning-tree vlan root primary 指定根交換機(基于vlan)
switch(config)#spanning-tree vlan root secondary 指定備用根交換機(基于vlan)
switch(config)#spanning-tree vlan priority 指定交換機優先級(基于vlan)
switch(config)#no spanning-tree vlan priority 將交換機的優先級恢復默認值(基于vlan)
switch(config-if)#spanning-tree vlan cost 指定端口成本(起用trunk的端口模式下)
switch(config-if)#spanning-tree vlan port-prioty 指定交換機端口優先級(基于vlan)
switch(config-if)#spanning-tree portfast 配置速端口(連接終端設備的端口狀態)如pc機
switch(config)#spanning-tree uplinkfast 配置上行速端口
注:在配置上行速端口前要先將基于vlan上的網橋優先級,網橋成本恢復默認值。起用了該命令后在進行優先級更改,
switch(config)#spanning-tree vlan hello-time 配置交換機hello時間(基于vlan)
switch(config)#spanning-tree vlan forward-time 修改轉發延遲計時器(基于vlan)
switch(config)#spanning-tree vlan max-time 修改最大老化時間(基于vlan)
注:vlan為可選參數,當沒有該參數時將修改所有vlan網橋的優先級及所有的vlan端口成本
switch#show spanning-tree summery 檢測vlan生成樹配置
switch#show spanning-tree vlan detail 瀏覽詳細生成樹配置信息
switch#show spanning-tree interface detail 瀏覽詳細生成樹端口配置信息
常見命令六、交換機顯示命令:
switch#show vtp status 查看vtp配置信息
switch#show running-config 查看當前配置信息
switch#show vlan 查看vlan配置信息
switch#show interface 查看端口信息
switch#show int f0/0 查看指定端口信息
switch#dir flash: 查看閃存
switch#show version 查看當前版本信息
switch#show mac-address-table aging-time 查看mac超時時間
switch#show cdp cisco設備發現協議 (可以查看聆接設備)
switch#show cdp traffic 杳看接收和發送的cdp包統計信息
switch#show cdp neighbors 查看與該設備相鄰的cisco設備
switch#show interface f0/1 switchport 查看有關switchport的配置
switch#show cdp neighbors 查看與該設備相鄰的cisco設備
常見命令七、使用Telnet遠程式管理
switch(config)#interface vlan 1 進入vlan 1
switch(config-if)#ip address 設置IP地址
switch(config-if)#ip default-gateway 設置默認網關
switch(config)#line vty 0 4 進入虛擬終端
switch(config-line)#login 允許登錄
switch(config-line)#password xx 設置登錄口令
switch#exit 返回命令
常見命令八、交換機VLAN設置:
switch#vlan database 進入VLAN設置
switch(vlan)#vlan 2 建VLAN 2
switch(vlan)#name 名字 建VLAN 2的名稱
switch(vlan)#no vlan 2 刪vlan 2
注:刪除vlan時原屬于此vlan的端口處于非激活狀態,直到重新分配為止
switch(config)#int f0/1 進入端口1
switch(config-if)#switchport mode access 當前端口工作莫試
switch(config-if)#switchport access vlan 2 當前端口加入vlan 2
switch(config-if)#switchport mode trunk 設置為干線
switch(config-if)#switchport trunk encapsulation dot1q 設置vlan 中繼協議
switch(config-if)#no switchport mode 或 ( switchport mode access) 禁用干線
switch(config-if)#switchport trunk allowed vlan add 1,2 ;從Trunk中添加vlans
switch(config-if)#switchport trunk allowed vlan remove 1,2 ;從Trunk中刪除vlans
switch(config-if)#switchport trunk pruning vlan remove 1,2 ;從Trunk中關閉局部修剪
常見命令九、以太網通道配置
switch(config)#interface range fasternet0/1 - 2 將fasternet0/1和0/2 口捆綁 (成雙不成單)
switch(config-if)#channel-group 1 mode on 配置以太通道模式
switch(config-if)#port-channel load-balance {dst-mac | src-mac}在鏈路間實現負載均衡
switch#show etherchannel 1 summary 查看通道信息
switch#show etherchannel load-balance 查看通道信息
posted on 2013-08-07 14:43
親愛的小孩 閱讀(119)
評論(0) 編輯 收藏