當(dāng)前位置:
首頁(yè) >
思科交换机命令大全
發(fā)布時(shí)間:2023/12/10
32
豆豆
思科交換機(jī)基本配置命令
switch>enable ? ?進(jìn)入特權(quán)模式switch#config terminal ? ? 進(jìn)入全局模式switch(config)#hostname+xxx ? 設(shè)置主機(jī)名switch(config)#enable password ? 明文密碼switch(config)#enable secret ? ? 密文密碼switch(config)#ip default-gateway ?設(shè)置網(wǎng)關(guān)switch#show mac-address-table ?查看MAC地址switch(config)#logging synchronous ? 阻止控制臺(tái)信息覆蓋命令行上的輸入switch(config)#no ip domain-lookup ? 關(guān)閉DNS查看功能switch(config)#exec-timeout 0 0 ? ? ?阻止會(huì)話退出使用telnet遠(yuǎn)程式管理
switch(config)#line vty 0 4 ? ?進(jìn)入虛擬終端switch(config-line)#password xx ? ?設(shè)置登錄口令switch(config-line)#login ? ? 要求口令驗(yàn)證控制臺(tái)口令
switch(config)#line console 0 ? 進(jìn)入控制臺(tái)口switch(config-line)#password xx ?switch(config-line)# 設(shè)置登錄口令login ? 允許登錄cisco發(fā)現(xiàn)協(xié)議(cdp)
switch(config)#show cdp ? ? 顯示cisco設(shè)備全局配置信息switch(config)#show cdp interface端口 ? ? 查看cdp配置下端口信息switch(config)#show cdp neighbors ? ? ?顯示直連cisco設(shè)備信息switch(config)#show cdp neighbors detail ?查看鄰居詳細(xì)信息?思科交換機(jī)恢復(fù)出廠配置
switch#erase startup-configswitch#delete flash: vlan.dat配置接口標(biāo)識(shí)(區(qū)分路由器的各個(gè)接口)
switch(config)#interface fastethernet0/1switch(config)#description this is a fast ethernet port used to connecting the company's intranet!vtp配置
switch(config)#vtp domain ?設(shè)置VTP域名switch(config)#vtp password xx ?設(shè)置VTP密碼switch(config)#vtp mode server/client/transparent ?設(shè)置VTP服務(wù)模式switch(config)#vtp version ? ? 設(shè)置VTP版本switch(config)#vtp pruning ? 設(shè)置VTP修解 ?vlan基本配置
switch#vlan database ? ? ? ? ? ? ? ? ? ? ? 進(jìn)入vlan配置模式switch(vlan)#vlan 號(hào)碼 name 名稱 ? ? ? 創(chuàng)建vlan及vlan名switch(vlan)#vlan 號(hào)碼 mtu 數(shù)值 ? ? ? ? 修改MTU大小?switch(vlan)#exit ? ? ? ? ? ? ? ? ? ? ? ? ?更新vlan數(shù)據(jù)并退出switch#show vlan ? ? ? ? ? ? ? ? ? ? ? ? ? 查看vlanswitch#copy running-config startup-config ? ? ? 保存配置vlan中添加刪除端口
switch#conf tswitch(config)#interface fastethernet0/1 ? ? 進(jìn)入要分配的端口switch(config-if)#switchport mode access ? ? ? ?定義二層端口switch(config-if)#switchport access vlan號(hào)碼 ? ?把端口發(fā)給一個(gè)vlanswitch(config-if)#switchport mode trunk ? ? ? ? 設(shè)置為干線switch(config-if)#switchport trunk encapsulation dotlq ? ? 設(shè)置vlan中繼協(xié)議switch(config-if)#no switchport mode 或 (switchport mode access) ?禁用干線switch(config-if)#switchport trunk allowed vlan add 1,2 ? ? ?從trunk中添加vlansswitch(config-if)#switchport trunk allowed vlan remove1,2 ? ? ? 從trunk中刪除vlanswitch(config-if)#switchport trunk pruning vlan remove1,2 ? ? ? ? ?配置接口為動(dòng)態(tài)協(xié)商模式
switch(config)#interface 接口號(hào)switch(config)#switchport mode dynamic desirable/auto生成樹stp
switch(config)#spanning-tree vlan ? 啟用stp生成樹(基于vlan)switch(config)#spanning-tree vlan root primary ? 指定交換機(jī)(基于vlan)switch(config)#spanning-tree vlan root secondary ? 指定備用根交換機(jī)(基于vlan)switch(config)#spanning-tree vlan priority<0-65535> ?指定交換機(jī)優(yōu)先繼(基于vlan)switch(config)#no spanning-tree vlan priority ? ? ?將交換機(jī)的優(yōu)先級(jí)恢復(fù)默認(rèn)值(基于vlan)switch(config-if)#spanning-tree vlan cost<0-200000000> ? 指定端口成本(起用trunk的端口模式下)switch(config-if)#spanning-tree vlan port-prioty<0-255> ? ?指定交換機(jī)端口優(yōu)先級(jí)(基于vlan)switch(config-if)#spanning-tree portfast ? ?配置速端口(連接終端設(shè)備的端口狀態(tài))如pc機(jī)switch(config)#spanning-tree uplinkfast ? 配置上行速端口- 注:在配置上行速端口前要先將基于vlan上的網(wǎng)橋優(yōu)先級(jí),網(wǎng)橋成本恢復(fù)默認(rèn)值。起用了該命令后在進(jìn)行優(yōu)先級(jí)更改。
- 注:vlan為可選參數(shù),當(dāng)沒(méi)有該參數(shù)時(shí)將修改所有vlan網(wǎng)橋的優(yōu)先級(jí)\及所有的vlan端口成本
以太網(wǎng)通道配置
switch(config)#interface range fastemet0/1-2 ?將fastemet0/1和0/2口捆綁switch(config-if)#change-group 1 mode on ? ? 配置以太通道模式switch(config-if)#port-channel load-batance{dst-mac|src-mac}在鏈路間實(shí)現(xiàn)負(fù)載均衡switch#show etherchannel 1 summary ? ? ?查看通道信息switch#show etherchannel load-balance ? ?查看通道信息交換機(jī)顯示命令
switch#show vtp status ?查看vtp配置信息?switch#show running-config ?查看當(dāng)前配置信息switch#show vlan ? ? 查看vlan配置信息switch#show interface ?查看端口信息switch#show int f0/0 ?查看指定端口信息?switch#dir flash: ?查看閃存switch#show version ?查看當(dāng)前版本信息switch#show cdp cisco ?設(shè)備發(fā)現(xiàn)協(xié)議(可以查看聆接設(shè)備)switch#show cdp traffic ?查看接收和發(fā)送的cdp包統(tǒng)計(jì)信息switch#show interface f0/1 switchport ?查看有關(guān)switchport的配置switch#show cdp neighbors ?查看與該設(shè)備相鄰的cisco設(shè)備CISCO交換機(jī)巡檢命令
1、??show interface stats???;查看交換機(jī)所有接口當(dāng)前接口流量2、??show running-config???;查看當(dāng)前設(shè)備配置3、??show version???;查看IOS版本信息及設(shè)備正常運(yùn)行時(shí)間4、??show clock???;查看設(shè)備時(shí)鐘信息5、??show vtp status???;查看交換機(jī)vtp配置模式6、??show vtp password???;查看交換機(jī)vtp配置口令7、??show env all???;查看設(shè)備溫度,電源和風(fēng)扇運(yùn)轉(zhuǎn)參數(shù)及是否報(bào)警8、??show inventory???;調(diào)取設(shè)備內(nèi)部板卡出廠模塊型號(hào)及序列號(hào)9、??show spanning-tree root???;查看交換機(jī)生成樹根位置10、??show cdp neighbors???;查看鄰接cisco設(shè)備基本信息11、??show cdp neighbors detail???;查看鄰接cisco設(shè)備詳細(xì)信息12、??show interface status???;查看交換機(jī)接口狀態(tài)是否存在errordisable接口disable接口13、show interface summary ;查看交換機(jī)所有接口當(dāng)前接口流量14、??show interface | i errors|FastEthernet|GigabitEthernet???;查看接口是否存在大量input或output errors包錯(cuò)誤15、??show processes cpu???;查看設(shè)備cpu負(fù)載16、??show processes mem???;查看設(shè)備mem負(fù)載17、??show access-list???;查看訪問(wèn)控制列表配置及匹配數(shù)據(jù)包數(shù)量18、??show logging???;查看本機(jī)內(nèi)部日志記錄情況19、??show ip route???;查看路由表20、??show firewall???;檢查防火墻的工作模式21、??show conn count???;檢查防火墻并發(fā)數(shù)22、??show xlate count???;檢查防火墻nat工作狀態(tài)
?
總結(jié)
- 上一篇: 求一个有限长度字符串 最长的有序可重复字
- 下一篇: 【常见笔试面试算法题12续集五】动态规划