A. 10個常見cisco交換機的操作命令,並介紹其作用
1. 交換機支持的命令:
交換機基本狀態:
switch: ;ROM狀態, 路由器是rommon>hostname> ;用戶模式hostname# ;特權模式hostname(config)# ;全局配置模式hostname(config-if)# ;介面狀態
交換機口令設置: switch>enable ;進入特權模式switch#config terminal ;進入全局配置模式switch(config)#hostname ;設置交換機的主機名switch(config)#enable secret xxx ;設置特權加密口令switch(config)#enable password xxa ;設置特權非密口令switch(config)#line console 0 ;進入控制台口switch(config-line)#line vty 0 4 ;進入虛擬終端switch(config-line)#login ;允許登錄switch(config-line)#password xx ;設置登錄口令xxswitch#exit ;返回命令
交換機VLAN設置:
switch#vlan database ;進入VLAN設置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;刪vlan 2switch(config)#int f0/1 ;進入埠1switch(config-if)#switchport access vlan 2 ;當前埠加入vlan 2switch(config-if)#switchport mode trunk ;設置為干線switch(config-if)#switchport trunk allowed vlan 1,2 ;設置允許的vlanswitch(config-if)#switchport trunk encap dot1q ;設置vlan 中繼switch(config)#vtp domain ;設置發vtp域名switch(config)#vtp password ;設置發vtp密碼switch(config)#vtp mode server ;設置發vtp模式switch(config)#vtp mode clIEnt ;設置發vtp模式
交換機設置IP地址:
switch(config)#interface vlan 1 ;進入vlan 1switch(config-if)#ip address ;設置IP地址switch(config)#ip default-gateway ;設置默認網關switch#dir flash: ;查看快閃記憶體
交換機顯示命令:
switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看當前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看埠信息switch#show int f0/0 ;查看指定埠信息
2. 路由器支持的命令:
路由器顯示命令:
router#show run ;顯示配置信息router#show interface ;顯示介面信息router#show ip route ;顯示路由信息router#show cdp nei ;顯示鄰居信息router#reload ;重新起動
路由器口令設置:
router>enable ;進入特權模式router#config terminal ;進入全局配置模式router(config)#hostname ;設置交換機的主機名router(config)#enable secret xxx ;設置特權加密口令router(config)#enable password xxb ;設置特權非密口令router(config)#line console 0 ;進入控制台口router(config-line)#line vty 0 4 ;進入虛擬終端router(config-line)#login ;要求口令驗證router(config-line)#password xx ;設置登錄口令xxrouter(config)#(Ctrl+z) ; 返回特權模式router#exit ;返回命令
路由器配置:
router(config)#int s0/0 ;進入Serail介面router(config-if)#no shutdown ;激活當前介面router(config-if)#clock rate 64000 ;設置同步時鍾router(config-if)#ip address ;設置IP地址router(config-if)#ip address second ;設置第二個IProuter(config-if)#int f0/0.1 ;進入子介面router(config-subif.1)#ip address ;設置子介面IProuter(config-subif.1)#encapsulation dot1q ;綁定vlan中繼協議router(config)#config-register 0x2142 ;跳過配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引導
路由器文件操作:
router# running-config startup-config ;保存配置router# running-config tftp ;保存配置到tftprouter# startup-config tftp ;開機配置存到tftprouter# tftp flash: ;下傳文件到flashrouter# tftp startup-config;下載配置文件ROM狀態:
Ctrl+Break ;進入ROM監控狀態
rommon>confreg 0x2142 ;跳過配置文件
rommon>confreg 0x2102 ;恢復配置文件
rommon>reset ;重新引導
rommon> xmodem: flash: ;從console傳輸文件
rommon>IP_ADDRESS=10.65.1.2 ;設置路由器IP
rommon>IP_SUBNET_MASK=255.255.0.0 ;設置路由器掩碼
rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP伺服器IP
rommon>TFTP_FILE=c2600.bin ;指定下載的文件
rommon>tftpdnld ;從tftp下載
rommon>dir flash: ;查看快閃記憶體內容
rommon>boot ;引導IOS
靜態路由:
ip route ;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;靜態路由舉例router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默認路由舉例
動態路由:
router(config)#ip routing ;啟動路由轉發router(config)#router rip ;啟動RIP路由協議。router(config-router)#network ;設置發布路由router(config-router)#negihbor ;點對點幀中繼用。
B. 思科三層交換機配置命令
1. 交換機支持的命令:
交換機基本狀態:
switch: ;ROM狀態, 路由器是rommon>
hostname> ;用戶模式
hostname# ;特權模式
hostname(config)# ;全局配置模式
hostname(config-if)# ;介面狀態
交換機口令設置:
switch>enable ;進入特權模式
switch#config terminal ;進入全局配置模式
switch(config)#hostname ;設置交換機的主機名
switch(config)#enable secret xxx ;設置特權加密口令
switch(config)#enable password xxa ;設置特權非密口令
switch(config)#line console 0 ;進入控制台口
switch(config-line)#line vty 0 4 ;進入虛擬終端
switch(config-line)#login ;允許登錄
switch(config-line)#password xx ;設置登錄口令xx
switch#exit ;返回命令
交換機VLAN設置:
switch#vlan database ;進入VLAN設置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;刪vlan 2
switch(config)#int f0/1 ;進入埠1
switch(config-if)#switchport access vlan 2 ;當前埠加入vlan 2
switch(config-if)#switchport mode trunk ;設置為干線
switch(config-if)#switchport trunk allowed vlan 1,2 ;設置允許的vlan
switch(config-if)#switchport trunk encap dot1q ;設置vlan 中繼
switch(config)#vtp domain ;設置發vtp域名
switch(config)#vtp password ;設置發vtp密碼
switch(config)#vtp mode server ;設置發vtp模式
switch(config)#vtp mode client ;設置發vtp模式
交換機設置IP地址:
switch(config)#interface vlan 1 ;進入vlan 1
switch(config-if)#ip address ;設置IP地址
switch(config)#ip default-gateway ;設置默認網關
switch#dir flash: ;查看快閃記憶體
交換機顯示命令:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看當前配置信息
switch#show vlan ;查看vlan配置信息
switch#show interface ;查看埠信息
switch#show int f0/0 ;查看指定埠信息
補充 :
3層交換機多出的就是路由能力,體現在vlan的互相通信功能和埠的路由能力,下面介紹:
開啟路由功能:ip routing
進入vlan 配置網段網關與路由配置介面相同
interface vlan 1
ip 192.168.1.1 255.255.255.0
路由配置與路由器配置相同只是把介面換為VLAN+VLAN號,開啟介面路由功能,進入介面配置:no swichport
C. 思科交換機配置命令
CISCO 3550交換機配置DHCP命令及步驟如下:
CISCO 3550交換機配置DHCP第一步:創建VLAN:
Switch>Vlan Database
Switch(Vlan)>Vlan 2 Name server
Switch(Vlan)>Vlan 3 Name work01
Switch(vlan)>Vlan 4 Name work02
CISCO 3550交換機配置DHCP第二步:啟用DHCP中繼代理:
/*關鍵一步,若缺少以下兩條命令,在VLAN中使用「IP HELPER-ADDRESS DHCP伺服器地址」指定DHCP伺服器,客戶機仍然不能獲得IP地址*/
Switch>Enable
Switch#Config t
Switch(Config)Service Dhcp
Switch(Config)Ip Dhcp Relay Information Option
CISCO 3550交換機配置DHCP第三步:設置VLAN IP地址:
Switch(Config)>Int Vlan 2
Switch(Config-vlan)Ip Address 192.168.2.1 255.255.255.0
Switch(Config-vlan)No Shut
Switch(Config-vlan)>Int Vlan 3
Switch(Config-vlan)Ip Address 192.168.3.1 255.255.255.0
Switch(Config-vlan)No Shut
Switch(Config-vlan)>Int Vlan 4
Switch(Config-vlan)Ip Address 192.168.4.1 255.255.255.0
Switch(Config-vlan)No Shut
Switch(Config-vlan)Exit
D. 思科交換機的命令解釋
3560_1(config)#interface range g1/1-2 ///進入介面組 g1和g2(千兆介面)
3560_1(config-if)#switch trunk enc dot1q ////(g1和g2)介面封裝模式設置為802.1q
3560_1(config-if)#switch mode trunk ////(g1和g2)介面模式設置為幹道模式(與交換機互聯)
3560_1(config-if)#channel-group 2 mode on ////綁定乙太網通道(把兩條物理鏈路綁定為一條邏輯的鏈路,從而增加帶寬,兩條千兆介面的鏈路綁定後就為一條2千兆的鏈路),組號為2
3560_1(config)#spanning-tree vlan 50 root primary ////設置交換機為vlan50的生成樹主根(PVST+協議)
3560_1(config)#spanning-tree vlan 51 root secondary ////設置交換機為vlan51的生成樹次根(PVST+協議)
3560_1(config)#int vlan 50 ////進入vlan50的SVI(虛介面)
3560_1(config-if)#ip add 182.168.50.2 255.255.255.0 ////配置IP(這個不用說了吧)
3560_1(config-if)#standby 3 ip 182.168.50.1 //G3的虛地址 (配置vlan50的HSRP熱備份路由的虛擬網關地址)
3560_1(config-if)#standby 3 pri 150 //設置優先順序,默認為100 (很明顯這台三層交換機是vlan50的活躍路由,只要是vlan50的數據包,都是由這台三層交換機來轉發的)
3560_1(config-if)#standby 3 preempt //配置搶占(這個也不用說吧,不配的話,它不會搶)
3560_1(config-if)#standby 3 track g0/48 90 //跟蹤上聯鏈路,down後,優先順序降90
3560_1(config)#int vlan 51 ////進入vlan50的SVI(虛介面)
3560_1(config-if)#ip add 182.168.51.3 255.255.255.0
3560_1(config-if)#standby 4 ip 182.168.51.1 (配置vlan51的HSRP熱備份路由的虛擬網關地址)
3560_1(config-if)#standby 4 preempt //////配置佔先權(這台交換機為vlan51的網關備份路由設備)
3560_1(config)#udld aggsive //開啟udld,並設置為aggsive模式,產生單通就down
3560_1(config)#interface range g1/1-2
3560_1(config-if)#udld port aggsive //介面開啟udld
這是一個非常經典的解決方案,希望你要理解每條命令的作用,還有協議的工作機制
E. 思科交換機的配置保存命令
1、首先打開思科交換CLI,從特權模式進入全局配置模式,如下圖所示。
F. 思科2950交換機常用命令有哪些
交換機配置命令
類別 命令格式 命令含義
基本配置 S> enable 進入特權模式
S# configure terminal 進入全局配置模式
S(config)# hostname name 改變交換機名稱
S(config)# enable password level level_# password 設置用戶口令(level_#=1)或特權口令(level_#=15)
S(config)# line console 0 進入控制台介面
S(config-line)# password console_password 接上一條命令,設置控制台口令
S(config)# line vty 0 15 進入虛擬終端
S(config-line)# password telnet_password 接上一條命令,設置Telnet口令
S(config-line)# login 允許Telnet登錄
S(config)# enable password|secret privilege_password 配置特權口令(加密或不加密)
S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 進入介面子配置模式
S(config-if)# [no] shutdown 關閉或啟用該介面(默認啟用)
S(config)# ip address IP_address sunbet_mask 指定IP地址
S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址為默認網關
S# show running-config 查看當前的配置
S# running-config startup-config 將RAM中的當前配置保存到NVRAM中
S> show interface [type slot_#/port_#] 查看所有或指定介面的信息
S> show ip 顯示交換機的IP配置(只在1900系列上可用)
S> show version 查看設備信息
S# show ip interface brief 驗證IP配置
S(config-if)# speed 10|100|auto 設置介面速率
S(config-if)# plex auto|full|half 設置介面雙工模式
S> show mac-address-table 查看CAM表
S# clear mac-address-table 清除CAM表中的動態條目
1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_# 在CAM表中創建靜態條目
2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/] port_# 在CAM表中創建靜態條目
1900(config)# mac-address-table restricted static MAC_address source_port list_of_allowed_interface 設置靜態埠安全措施
1900(config-if)# port secure 啟用粘性學習
1900(config-if)# port secure max-mac-count value 設置粘性學習特性能夠學到的地址數量(默認132,取值范圍是1-132)
1900(config)# address-violation suspend|ignore|disable 改變安全選項
1900> show mac-address-table security 驗證埠安全措施
2950(config)# switchport mode access 定義介面為主機埠而不是中繼埠
2950(config)# switchport port-security 啟用埠安全措施
2950(config)# switchport port-security maximum value 指定可與此介面相關的設備的最大數量
2950(config)# switchport port-security violation protect|restrict|shutdown 指定出現安全違規時應該發生的事
2950(config)# switchport port-security mac-address MAC_address 指定允許與此介面相關的確切的MAC地址
G. 思科交換機詳細配置方法和命令
思科交換機的基本配置命令學習
一、交換機口令設置:
switch>enable ;進入特權模式
switch#config terminal ;進入全局配置模式
switch(config)#hostname csico ;設置交換機的主機名
switch(config)#enable secret
csico1 ;設置特權加密口令
switch(config)#enable password csico8 ;設置特權非密口令
switch(config)#line console 0 ;進入控制台口
switch(config-line)#line vty 0 4
;進入虛擬終端
switch(config-line)#login ;虛擬終端允許登錄
switch(config-line)#password
csico6 ;設置虛擬終端登錄口令csico6
switch#exit ;返回命令
二、交換機顯示命令:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看當前配置信息
switch#show
vlan ;查看vlan配置信息
switch#show interface ;查看埠信息
switch#show int f0/0
;查看指定埠信息
switch#show int f0/0 status;查看指定埠狀態
switch#dir flash: ;查看快閃記憶體
Cisco路由器配置命令大全網路 2010-06-26 06:43:44 閱讀657 評論0 字型大小:大中小 訂閱 .
(1)模式轉換命令
用戶模式----特權模式,使用命令"enable"
特權模式----全局配置模式,使用命令"config
t"
全局配置模式----介面模式,使用命令"interface+介面類型+介面號"
全局配置模式----線控模式,使用命令"line+介面類型+介面號"
注:
用戶模式:查看初始化的信息.
特權模式:查看所有信息、調試、保存配置信息
全局模式:配置所有信息、針對整個路由器或交換機的所有介面
介面模式:針對某一個介面的配置
線控模式:對路由器進行控制的介面配置
(2)配置命令
show running config 顯示所有的配置
show
versin 顯示版本號和寄存器值
shut down 關閉介面
no shutdown 打開介面
ip add +ip地址
配置IP地址
secondary+IP地址 為介面配置第二個IP地址
show interface+介面類型+介面號 查看介面管理性
show controllers interface 查看介面是否有DCE電纜
show history 查看歷史記錄
show
terminal 查看終端記錄大小
hostname+主機名 配置路由器或交換機的標識
config memory
修改保存在NVRAM中的啟動配置
exec timeout 0 0 設置控制台會話超時為0
service password-encryptin
手工加密所有密碼
enable password +密碼 配置明文密碼
ena sec +密碼 配置密文密碼
line vty 0
4/15 進入telnet介面
password +密碼 配置telnet密碼
line aux 0 進入AUX介面
password
+密碼 配置密碼
line con 0 進入CON介面
password +密碼 配置密碼
bandwidth+數字 配置帶寬
no ip address 刪除已配置的IP地址
show startup config 查看NVRAM中的配置信息
run-config atartup config 保存信息到NVRAM
write 保存信息到NVRAM
erase
startup-config 清除NVRAM中的配置信息
show ip interface brief 查看介面的謫要信息
banner
motd # +信息 + # 配置路由器或交換機的描素信息
description+信息 配置介面聽描素信息
vlan database
進入VLAN資料庫模式
vlan +vlan號+ 名稱 創建VLAN
switchport access vlan +vlan號
為VLAN為配介面
interface vlan +vlan號 進入VLAN介面模式
ip add +ip地址 為VLAN配置管理IP地址
vtp+service/tracsparent/client 配置SW的VTP工作模式
vtp +domain+域名 配置SW的VTP域名
vtp +password +密碼 配置SW的密碼
switchport mode trunk 啟用中繼
no vlan +vlan號
刪除VLAN
show spamming-tree vlan +vlan號 查看VLA怕生成樹議
三. 路由器配置命令
ip
route+非直連網段+子網掩碼+下一跳地址 配置靜態/默認路由
show ip route 查看路由表
show protocols
顯示出所有的被動路由協議和介面上哪些協議被設置
show ip protocols 顯示了被配置在路由器上的路由選擇協議,同時給出了在路由選擇協議中使用
的定時器
等信息
router rip 激活RIP協議
network +直連網段 發布直連網段
interface lookback 0 激活邏輯介面
passive-interface +介面類型+介面號 配置介面為被動模式
debug ip +協議 動態查看路由更新信息
undebug all 關閉所有DEBUG信息
router eigrp +as號
激活EIGRP路由協議
network +網段+子網掩碼 發布直連網段
show ip eigrp neighbors 查看鄰居表
show ip eigrp topology 查看拓撲表
show ip eigrp traffic 查看發送包數量
router
ospf +process-ID 激活OSPF協議
network+直連網段+area+區域號 發布直連網段
show ip ospf
顯示OSPF的進程號和ROUTER-ID
encapsulation+封裝格式 更改封裝格式
no ip admain-lookup
關閉路由器的域名查找
ip routing 在三層交換機上啟用路由功能
show user 查看SW的在線用戶
clear line
+線路號 清除線路
四. 三層交換機配置命令
配置一組二層埠
configure terminal 進入配置狀態
nterface range {port-range} 進入組配置狀態
配置三層埠
configure terminal 進入配置狀態
interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} |
{port-
channel port-channel-number} 進入埠配置狀態
no switchport
把物理埠變成三層口
ip address ip_address subnet_mask 配置IP地址和掩碼
no shutdown 激活埠
例:
Switch(config)# interface gigabitethernet0/2
Switch(config-if)#
no switchport
Switch(config-if)# ip address 192.20.135.21 255.255.255.0
Switch(config-if)# no shutdown
配置VLAN
configure terminal 進入配置狀態
vlan vlan-id 輸入一個VLAN號, 然後進入vlan配態,可以輸入一個新的VLAN號或舊的來進行修改
H. 交換機的常用配置命令
a、更改遠程TELNNET密碼
Switch#configure terminal
Switch(config)#line vty 0 4
Switch(config-line)#password qycx123
Switch(config-line)#login
Switch(config-line)#exit
b、更改進入全局配置模式時的密碼
Switch#configure terminal
Switch(config)#enable secret qycx123
思科交換機常用命令——創建並劃分VLAN
a、創建VLAN
Switch#vlan database
Switch(vlan)#vlan 99 name office (創建vlan 99 並命名為office)
b、將埠劃分至vlan
Switch(config)#interface fastEthernet 0/8
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 99 (將8號快速以太口劃分至vlan 99)
思科交換機常用命令——調試命令
a、顯示所有配置命令:Switch#show run
b、顯示所有介面狀態:Switch#show ip int brief
c、顯示所有VLAN的信息:Switch#show vlan brief
cisco交換機還是比較常用的,於是我研究了一下Cisco交換機命令的大總結,在這里拿出來和大家分享一下,希望對大家有用。我所針對的都是Cisco的設備而言的,華為的可以跟據手冊來查,配置都是差不多的,這里華子就不多寫華為的設備了,了解的也不是很多。
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 返回命令
Cisco交換機命令之控制台口令
switch(config)#line console 0 進入控制台口
switch(config-line)#login 允許登錄
switch(config-line)#password xx 設置登錄口令
switch#exit 返回命令
Cisco交換機命令之基本介面配置
switch(config)#interface f0/1 進入f0/1介面
switch(config-if)#plex 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# running-config startup-config 保存當前配置nvram
switch#erase startup-config 清除配置文件
Cisco交換機命令之交換機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中關閉局部修剪
Cisco交換機命令之乙太網通道配置
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 查看通道信息
Cisco交換機命令之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 名更改
Cisco交換機命令之生成樹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 配置上行速埠
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)
switch#show spanning-tree summery 檢測vlan生成樹配置
switch#show spanning-tree vlan detail 瀏覽詳細生成樹配置信息
switch#show spanning-tree interface detail 瀏覽詳細生成樹埠配置信息
Cisco交換機命令之交換機顯示命令:
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設備
I. 思科2960交換機配置命令都有哪些
思科2960交換機配置命令如下:
1、access: 主要用來接入終端設備,如PC機、伺服器、列印伺服器等。
2、trunk: 主要用在連接其它交換機,以便在線路上承載多個vlan。
3、multi: 在一個線路中承載多個vlan,但不像trunk,它不對承載的數據打標簽。主要用於接入支持多vlan的伺服器或者一些網路分析設備。現在基本不使用此類介面,在cisco的網路設備中,也基本不支持此類介面了。
交換機口令設置:
1、switch>enable;進入特權模式、switch#configterminal;進入全局配置模式、switch(config)#hostname;設置交換機的主機名。
2、switch(config)#enablesecretxxx;設置特權加密口令、switch(config)#enablepasswordxxa;設置特權非密口令。
3、switch(config)#lineconsole0;進入控制台口、switch(config-line)#linevty04;進入虛擬終端。
4、switch(config-line)#login;允許登錄、switch(config-line)#passwordxx;設置登錄口令xx、switch#exit;返回命令。
J. 思科交換機關閉埠命令
思科交換機關閉埠命令是shut down。
思科shutdown是關閉介面,介面狀態會變為DOWN,no shutdown是激活介面,狀態變為UP。
多數Cisco交換機默認具有處於非連接狀態的埠。這表示埠當前沒有連接到任何設備,但如果將其連接到其他正常運行的設備,它將可以建立連接。
Cisco的工作模式
Cisco設備有常用模式為:用戶模式、特權模式、全局模式、埠模式。它們之間呈現出遞進關系:用戶模式->特權模式->全局模式->埠模式。
1、用戶模式
交換機啟動完成後按下Enter鍵,首先進入的就是用戶模式,在些用戶模式下用戶將受到極大的限制,只能用來查看一些統計信息。
Switch>
2、特權模式
在用戶模式下輸入enable(可簡寫為en(命令就可以進入特權模式,用戶在該模式下可以查看並修改Cisco設備的配置。
Switch>en
Switch#
3、全局配置模式在特權模式下輸入config terminal(可簡寫conf t)命令即可,用戶在該模式下可修改交換機的全局配置。如修改主機名。
Switch#conf t
Switch(config)#
4、介面模式
在全局配置模式下輸入interface fastethernet 0/1(可簡寫int f0/1)就可以進入到介面模式,在這個模式下所做的配置都是針對f0/1這個介面所設定的。如設定IP等
Switch(config)#int f0/1
Switch(config-if)#
退回到上一模式用exit命令