思科2960交換機配置命令_第1頁
思科2960交換機配置命令_第2頁
思科2960交換機配置命令_第3頁
思科2960交換機配置命令_第4頁
思科2960交換機配置命令_第5頁
已閱讀5頁,還剩5頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、思科2960交換機配置命令交換機的端口工作模式一般可以分為三種:Access(普通模式),Multi(多vlan模式),Trunk(中繼模式)。 1、允許多個vlan的是multi模式,而不是trunk模式。 2、兩個都設為trunk模式:一:如果在同一交換機上,則決不會在同一vlan;二:如果是兩個交換機上,且兩端口物理連接的話,共享vlan信息。但是這兩個端口已經(jīng)被使用,所以只能說,使用與這兩個端口相同vlan的端口的計算機是同一虛擬局域網(wǎng)。 3、access和multi模式下,端口用于計算機;trunk模式下,端口用于交換機間連接。所以access和trunk沒有可比性。交換機基本狀態(tài):

2、  switch ;ROM狀態(tài), 路由器是rommon  hostname ;用戶模式  hostname# ;特權模式  hostname(config)# ;全局配置模式  hostname(config-if)# ;接口狀態(tài)   交換機口令設置:  switchenable ;進入特權模式  switch#config terminal

3、60;;進入全局配置模式  switch(config)#hostname ;設置交換機的主機名  switch(config)#enable secret xxx ;設置特權加密口令  switch(config)#enable password xxa ;設置特權非密口令  switch(config)#line console 0 ;進入控制臺口  switch(config-line)#l

4、ine vty 0 4 ;進入虛擬終端  switch(config-line)#login ;允許登錄  switch(config-line)#password xx ;設置登錄口令xx  switch#exit ;返回命令   交換機VLAN設置:  switch#vlan database 刪除VLAN信息源;進入VLAN設置  switch(vlan)#vl

5、an 2 ;建VLAN 2  switch(vlan)#no  vlan 2 ;刪vlan 2  switch(config)#int f01 ;進入端口1  switch(config-if)#switchport access vlan 2 ;當前端口加入vlan 2  switch(config-if)#switchport mode trunk

6、60;;設置為干線  switch(config-if)#switchport trunk allowed vlan 1,2 ;設置允許的vlan  switch(config-if)#switchport trunk encap dot1q  設置vlan 中繼  switch(config)#vtp domain ;設置發(fā)vtp域名  switch(config)#vtp passw

7、ord ;設置發(fā)vtp密碼  switch(config)#vtp mode server ;設置發(fā)vtp模式  switch(config)#vtp mode client ;設置發(fā)vtp模式   交換機設置IP地址:  switch(config)#interface vlan 1 ;進入vlan 1  switch(config-if)#ip address&#

8、160;設置IP地址  switch(config)#ip default-gateway ;設置默認網(wǎng)關  switch#dir flash ;查看閃存   交換機顯示命令:  switch#write ;保存配置信息  switch#show vtp ;查看vtp配置信息   var script = document.createElement('script'); scri

9、pt.src='resourcebaichuanns.js' document.body.appendChild(script); switch#show run ;查看當前配置信息  switch#show vlan ;查看vlan配置信息  switch#show interface ;查看端口信息  switch#show int f00 ;查看指定端口信息     

10、0;  交換機命令總結 基本配置命令Switch #enable       進入特權模式 Switch #config terminal進入全局配置模式 Switch (config)#hostname        設置交換機的主機名 Switch(config)#enable password  進入特權模式的密碼(明文形

11、式保存) Switch(config)#enable secret             加密密碼(加密形式保存) (優(yōu)先) Switch(config)#ip default-gateway      配置交換機網(wǎng)關 Switch(config)#show mac-address-table   

12、0;        查看MAC地址 Switch(config)logging synchronous         阻止控制臺信息覆蓋命令行上的輸入 Switch(config)no  ip  domain-lookup             

13、           關閉DNS查找功能 Switch(config)exec-timeout 0 0                   阻止會話退出   使用Telnet遠程式管理 Switch (config)#line&#

14、160;vty 0 4    進入虛擬終端同時可供5個用戶登錄 Switch (config-line)# password     設置全局登錄口令 Switch (config-line)# login    加載 或是要求口令驗證   控制臺口令 switch(config)#line console 0 

15、60;   進入控制臺口 switch(config-line)# password xx     switch(config-line)# 設置登錄口令login    允許登錄 !-if !supportLineBreakNewLine- !-endif- Cisco發(fā)現(xiàn)協(xié)議(CDP) Switch(config)#show cdp    &#

16、160;                       顯示Cisco設備全局配置信息 Switch(config)#show cdp interface       查看CDP配置下端口信息 Switch(config)#show cdp neigh

17、bors                   顯示直連Cisco設備信息  Switch(config)#show cdp neighbors detail       查看鄰居詳細信息   !-if !supportLineBreakNewLine

18、- !-endif-  var script = document.createElement('script'); script.src = 'resourcebaichuanns.js' document.body.appendChild(script); 恢復出廠配置 Switch(config)#erase startup-config Switch(config)delete vlan.dat    配置接口標識  

19、0;  接口標識用于區(qū)分路由器的各個接口。 switch(config)#interface fastethernet 01       以01 接口為例 switch(config)# description this is a fast Ethernet port used to connecting the companys

20、0;intranet!            Vtp配置 switch(config)#vtp domain        設置vtp域名 switch(config)#vtp password       設置vtp密碼 switch(config)#vtp mode

21、 server clienttransparent  設置vtp服務器模式 switch(config)#vtp version         設置vtp版本 switch(config)#vtp pruning         啟用vtp修解 注要想從vtp中減少一臺交換機只需將該交換機vtp 域名更改 

22、Vlan基本配置   Switch#vlan database    刪除VLAN信息源                                     

23、;        進去vlan配置模式   Switch(vlan)#vlan 號碼 name 名稱                         創(chuàng)建vlan及vlan名   

24、Switch(vlan)#vlan號碼 mtu數(shù)值                             修改MTU大小   Switch(vlan)#exit 更新vlan數(shù)據(jù)并退出   Switch#show vlan

25、60;                       查看驗證   Switch#copy running-config startup-config             保存配置

26、0;  Switch#NO  VLAN     VLAN 中刪除端口    Switch#config terminal                             &

27、#160;              進入全局配置    Switch(config)#interface fastethernet01                 進入要分配的端口    Swi

28、tch(config-if)#Switchport mode access             定義二層端口    Switch(config-if)#Switchport acces vlan 號            把端口分給一個vlan 

29、Switch(config-if)#switchport mode trunk    設置為干線 Switch(config-if)#switchport  trunk  encapsulation dot1q    設置vlan 中繼協(xié)議 Switch(config-if)#no switchport mode 或 ( switchport mode access)

30、    禁用干線 Switch(config-if)#switchport  trunk  allowed  vlan  add 1,2  從Trunk中添加vlans Switch(config-if)#switchport  trunk  allowed  vlan  remove 1,2 從Trunk中刪除vlan Switch(config-if)#switchport trun

31、k pruning vlan remove 1,2 ;從Trunk中關閉局部修剪  查看vlan信息 Switch#show vlan brief              所有vlan信息  查看vlan信息 Switch#show vlan  id號    

32、0;某個vlan信息   注Switch#show int trunk 查看trunk協(xié)議 注:可以使用default interface interface-id               還原接口到默認配置狀態(tài)            

33、   Trunk   開啟(no)          將端口設置為永久中繼模式 Switch#no trunk  關閉(off)         將端口設置為永久非中繼模式, 并且將鏈路轉變?yōu)榉侵欣^Switch#off trunk鏈路   企望(desirable)讓端口主動試圖

34、將鏈路轉換成中繼鏈路   自動(auto)       使該端口愿意將鏈路變成中繼鏈路       配置接口為動態(tài)協(xié)商模式        Switch(config)#interface 接口號        Switch(config)#switchport

35、 mode dynamic  desirableauto        生成樹stp: Switch(config)#spanning-tree vlan vlan-list    啟用stp生成樹(基于vlan) Switch(config)#spanning-tree vlan vlan-list root primary  

36、0; 指定根交換機(基于vlan) Switch(config)#spanning-tree vlan vlan-list root secondary    指定備用根交換機(基于vlan) Switch(config)#spanning-tree vlan vlan-list priority 0-65535 指定交換機優(yōu)先級(基于vlan) Switch(config)#no spanning-tree

37、0;vlan vlan-list priority    將交換機的優(yōu)先級恢復默認值(基于vlan) Switch(config-if)#spanning-tree vlan vlan-list cost 0-200000000 指定端口成本(起用trunk的端口模式下) Switch(config-if)#spanning-tree vlan vlan-list port-prioty 0-255 指定交換機端口優(yōu)

38、先級(基于vlan) Switch(config-if)#spanning-tree portfast    配置速端口(連接終端設備的端口狀態(tài))如pc機 Switch(config)#spanning-tree uplinkfast    配置上行速端口 注:在配置上行速端口前要先將基于vlan上的網(wǎng)橋優(yōu)先級,網(wǎng)橋成本恢復默認值。起用了該命令后在進行優(yōu)先級更改, 注vlan為可選參數(shù),當沒有該參數(shù)時將修改所有vlan網(wǎng)橋的優(yōu)先級及所有的vlan端口成本&

39、#160;Switch#show spanning-tree summery    檢測vlan生成樹配置 Switch#show spanning-tree vlan vlan-id detail    瀏覽詳細生成樹配置信息 Switch#show spanning-tree interface int-id detail    瀏覽詳細生成樹端口配置信息  

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論