• <output id="aynwq"><form id="aynwq"><code id="aynwq"></code></form></output>

    <mark id="aynwq"><option id="aynwq"></option></mark>
  • <mark id="aynwq"><option id="aynwq"></option></mark><label id="aynwq"><dl id="aynwq"></dl></label>
  • 學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 電腦硬件知識(shí) > 外接設(shè)備 >

    配置思科交換機(jī)用到哪些基本命令

    時(shí)間: 加城1195 分享

      交換機(jī)除了能夠連接同種類型的網(wǎng)絡(luò)之外,還可以在不同類型的網(wǎng)絡(luò)(如以太網(wǎng)和快速以太網(wǎng))之間起到互連作用。這篇文章主要介紹了Cisco 交換機(jī)基本配置命令及學(xué)習(xí)心得,需要的朋友可以參考下

      具體介紹

      1:配置登錄用戶,口令等

      Switch> //用戶直行模式提示符

      Switch>enable //進(jìn)入特權(quán)模式

      Switch# //特權(quán)模式(配置密碼后必須輸入密碼才可進(jìn)入特 權(quán)模式)

      Switch#config terminal //進(jìn)入全局配置模式

      Switch(config)# //配置模式提示符

      Switch(config)#hostname xxx //設(shè)置主機(jī)名成為xxx這里使用CISCO 2960G

      CISCO 2960G(config)#enable password xxx //設(shè)置使能口令為明文顯示為xxx

      CISCO 2960G(config)#enable secret xxx //設(shè)置使能口令為密文顯示為xxx

      CISCO 2960G(config)#line vty 0 15 //設(shè)置虛擬終端線,通過telnet方式 登錄允許0-15個(gè)用戶同事登錄

      CISCO 2960G(config-line)#login //設(shè)置遠(yuǎn)程telnet遠(yuǎn)程登錄驗(yàn)證

      CISCO 2960G(config-line)#password xxx //設(shè)置telnet登錄密碼

      2:cisco2960 VLan設(shè)置

      CISCO 2960G> enable //進(jìn)入特權(quán)模式

      CISCO 2960G#vlan database //進(jìn)入vlan設(shè)置

      CISCO 2960G(vlan)#vlan 2 name xxx //創(chuàng)建vlan 2,并給vlan命名

      CISCO 2960G(vlan)#no vlan 2 v //刪除vlan 2

      CISCO 2960G(vlan)#exit //回到特權(quán)模式下

      端口設(shè)置命令:

      CISCO 2960G(config)#interface fastethernet0/1 //進(jìn)入網(wǎng)口1,簡(jiǎn)化命令 int f0/1 ,0/1指的是第一個(gè)插槽上的第一個(gè)網(wǎng)口

      CISCO 2960G(config-if)# //接口視圖模式

      CISCO 2960G(config-if)#shutdown //關(guān)閉當(dāng)前端口

      CISCO 2960G(config-if)#no shutdown //打開當(dāng)前端口

      CISCO 2960G(config)#interface gigabyte0/1 //進(jìn)入?yún)R聚千兆口1,簡(jiǎn)化命令 int giga0/1指的是第一個(gè)插槽上的第一個(gè)匯聚網(wǎng)口

      CISCO 2960G(config-if)#

      CISCO 2960G(config-if)#duplex auto/full/half //設(shè)置端口工作模式為 自適應(yīng)/全雙通/半雙通

      CISCO 2960G(config-if)#switchport mode trunk //設(shè)置當(dāng)前端口模式為匯聚口

      CISCO 2960G(config-if)#switchport mode access //設(shè)置當(dāng)前端口模式為接入模式

      CISCO 2960G(config-if)#switchport trunk allowed vlan 1,2 //設(shè)置當(dāng)前匯聚端口允許vlan1,2通過,vlan修剪,默認(rèn)為all,全部允許

      CISCO 2960G(config-if)#switchport trunk vlan 2 //設(shè)置當(dāng)前匯聚端口允許vlan 2通過,vlan修剪

      CISCO 2960G(config-if)#switchport access vlan 2 //將當(dāng)前端口加入到vlan 2中

      CISCO 2960G(config-if)#switchport trunk encap dot1q //設(shè)置vlan中繼

      將端口加入vlan

      CISCO 2960G(config)#interface fastethernet0/1

      CISCO 2960G(config-if)#switchport mode access

      CISCO 2960G(config-if)#switchport access vlan 2

      將多個(gè)端口加入到VLAN中

      CISCO 2960G(config)#interface range f0/1 - 10

      CISCO 2960G(config-if-range)#switchport mode access

      CISCO 2960G(config-if-range)#switchport access vlan 2

      CISCO 2960G#show vlan brief //用于查看配置后結(jié)果

      CISCO 2960G#show vlan //用于查看配置后結(jié)果

      3:設(shè)置VTP cisco專有的vlan終極協(xié)議也成為局域網(wǎng)干道協(xié)議,作用是十幾臺(tái)交換機(jī)在企業(yè)網(wǎng)中,配置VLAN工作量大,可以使用VTP協(xié)議,把一臺(tái)交換機(jī)配置成VTP Server, 其余交換機(jī)配置成VTP Client,這樣他們可以自動(dòng)學(xué)習(xí)到server 上的VLAN 信息

      switch(config)#vtp domain xxxx //設(shè)置發(fā)vtp域名

      switch(config)#vtp password xxxx //設(shè)置發(fā)vtp密碼

      switch(config)#vtp mode server //設(shè)置發(fā)vtp模式為 vtp服務(wù)器

      switch(config)#vtp mode client //設(shè)置發(fā)vtp模式為 vtp客戶端

      4:交換機(jī)配置IP地址

      switch(config)#interface vlan 1 //進(jìn)入vlan 1

      switch(config-if)#ip address 119.167.223.221 255.255.255.128 //設(shè)置交換機(jī)的管理ip地址

      switch(config)#ip default-gateway 119.167.223.254 //設(shè)置交換機(jī)的默認(rèn)網(wǎng)關(guān)

      switch(config)#end //退出當(dāng)前模式

      5: 交換機(jī)保存設(shè)置命令

      switch#write //保存配置信息

      switch#copy running-config startup-config //將當(dāng)前正在使用中的配置保存到交換機(jī)開機(jī)需要加載的配置文件里去。

      6:交換機(jī)顯示命令

      特權(quán)模式下:

      switch#show vtp //顯示vtp配置信息

      switch#show run //顯示當(dāng)前配置信息

      switch#show running-config //顯示當(dāng)前正在使用的配置信息

      switch#show startup-config //交換機(jī)開機(jī)是自動(dòng)加載的 配置文件

      switch#show vlan //顯示vlaner配置信息

      switch#show interfaces //顯示端口配置信息

      switch#show interfaces fastethernet 0/1 switchport //顯示二層端口狀態(tài),可以用來決定此口是否為二層或三層口

      switch#show int f0/1 //查看指定端口配置信息 show interface fastethernet0/1

      switch#show ip interface vlan100 //查看交換機(jī)vlan100的ip配置信息

      switch#show version //查看交換機(jī)固件版本信息

      7:基于端口的mac地址綁定

      switch#config terminal //進(jìn)入配置視圖模式

      switch(config)#interface fasrethernet 0/1 //進(jìn)入具體端口視圖模式下

      switch(config-if)#switchport port-secruity //配置端口安全模式

      switch(config-if)#switchport port-secruity mac-address MAC(主機(jī)的mac地址) //配置該端口要綁定的主機(jī)的MAC地址

      switch(config-if)#no switchport port-secruity mac-address MAC(主機(jī)的mac地址) //刪除綁定主機(jī)的mac地址

      8:配置交換機(jī)的snmp功能

      switch(config)#snmp-server community xxx ro //xxx為自定義的共同體名稱,并且團(tuán)體的權(quán)限為只讀。

      switch(config)#snmp-server trap-source FastEthernet0/3/0 //設(shè)置snmp監(jiān)控的端口,此端口必須要配置IP地址才行

      switch(config)#snmp-server trap-source vlan 100 /把vlan 100接口作為監(jiān)控端口

      switch(config)#snmp-server host x.x.x.x(ip地址) xxx(團(tuán)體名) //設(shè)置管理機(jī)x.x.x.x,同時(shí)允許該管理機(jī)以團(tuán)體明xxx訪問。

      switch(config)#snmp-server host 119.167.223.221 zy //例子

      switch(config)#snmp-server enable traps //啟用snmp服務(wù)

      9:交換機(jī)禁ping配置

      switch(config)#access-list 110 deny icmp any any //配置訪問控制列表(Access Control List,ACL)110指的ICMP對(duì)應(yīng)ping。

      switch(config)#access-list 110 permit ip any any //運(yùn)行所有的IP協(xié)議的應(yīng)用

      switch(config)#int vlan 1

      switch(config-if)#ip access-group 110 in

      switch(config)#int vlan 2

      switch(config-if)#ip access-group 110 in

      switch(config)#int vlan 3

      switch(config-if)#ip access-group 110 in

      switch(config)#int fasrethernet 0/X

      switch(config-if)#ip access-group 110 in //端口X上禁ping

      10:恢復(fù)交換機(jī)出廠設(shè)置

      思科交換機(jī)分為兩種系統(tǒng),分別是IOS和CatOS,下面介紹IOS版本的操作,

      Switch#write erase

      Erasing the nvram filesystem will remove all files! Continue? [confirm]y[OK]

      Erase of nvram: complete

      Swtich# delete flash:vlan.dat ------------老版本需做此操作。

      Delete filename [vlan.dat]?

      Delete flash:vlan.dat? [confirm]y

      Switch#reload

      另一種方法是啟動(dòng)的時(shí)候按Mode進(jìn)入引導(dǎo)模式,執(zhí)行如下命令:

      flash_init

      rename flash:config.text flash:config.old

      boot

      11: 端口匯聚

      console>enable

      console#config

      console(config)#interface gigaethernet 0/1

      console(config-if)#speed 1000

      console(config-if)#duplex full

      console(config)#interface gigaethernet 0/2

      console(config-if)#speed 1000

      console(config-if)#duplex full

      console(config-if)#exit

      console(config)#interface range gigaethernet 0/1-0/2

      console(config-if)#channel-group 1 mode on/auto

      console(config-if)#switchport mode trunk

      console(config-if)#switchport trunk allowed vlan all

      console#show etherchannel summary //查看端口匯聚狀態(tài)。

      另外一臺(tái)交換機(jī)的對(duì)應(yīng)匯聚端口務(wù)必要和這里兩個(gè)匯聚口的設(shè)置一樣。

      R1#vlan database

      R1(vlan)#vlan 2

      R1(vlan)#exit

      R1#configure terminal

      R1(config)#int range fastethernet 0/1-4

      R1(config-int-range)# switchport access vlan 2

      R1(config-int-range)# channel-group 1 mode on

      R2#vlan database

      R2(vlan)#vlan 2

      R2(vlan)#exit

      R2#configure terminal

      R2(config)#int range fastethernet 0/1-4

      R2(config-int-range)# switchport access vlan 2

      R2(config-int-range)# channel-group 1 mode on

      同一個(gè)vlan里匯聚,端口使用access狀態(tài),多個(gè)VLAN之間匯聚端口才需要trunk狀態(tài)。

      相關(guān)閱讀:交換機(jī)工作原理過程

      交換機(jī)工作于OSI參考模型的第二層,即數(shù)據(jù)鏈路層。交換機(jī)內(nèi)部的CPU會(huì)在每個(gè)端口成功連接時(shí),通過將MAC地址和端口對(duì)應(yīng),形成一張MAC表。在今后的通訊中,發(fā)往該MAC地址的數(shù)據(jù)包將僅送往其對(duì)應(yīng)的端口,而不是所有的端口。因此,交換機(jī)可用于劃分?jǐn)?shù)據(jù)鏈路層廣播,即沖突域;但它不能劃分網(wǎng)絡(luò)層廣播,即廣播域。

      交換機(jī)擁有一條很高帶寬的背部總線和內(nèi)部交換矩陣。交換機(jī)的所有的端口都掛接在這條背部總線上,控制電路收到數(shù)據(jù)包以后,處理端口會(huì)查找內(nèi)存中的地址對(duì)照表以確定目的MAC(網(wǎng)卡的硬件地址)的NIC(網(wǎng)卡)掛接在哪個(gè)端口上,通過內(nèi)部交換矩陣迅速將數(shù)據(jù)包傳送到目的端口,目的MAC若不存在,廣播到所有的端口,接收端口回應(yīng)后交換機(jī)會(huì)“學(xué)習(xí)”新的MAC地址,并把它添加入內(nèi)部MAC地址表中。使用交換機(jī)也可以把網(wǎng)絡(luò)“分段”,通過對(duì)照IP地址表,交換機(jī)只允許必要的網(wǎng)絡(luò)流量通過交換機(jī)。通過交換機(jī)的過濾和轉(zhuǎn)發(fā),可以有效的減少?zèng)_突域,但它不能劃分網(wǎng)絡(luò)層廣播,即廣播域。


    配置思科交換機(jī)用到哪些基本命令相關(guān)文章:

    1.思科交換機(jī)配置命令有哪些

    2.思科常用配置命令及參數(shù)

    3.cisco思科交換機(jī)如何清除密碼

    4.思科模擬器上給交換機(jī)設(shè)置基本配置方法教程

    5.cisco設(shè)備常用命令有哪些

    4051697 主站蜘蛛池模板: 欧美日韩亚洲视频 | 在线播放亚洲精品| 久久久久久青草大香综合精品| 欧美激情视频二区| 动漫卡通精品3d一区二区| 韩国xxxx69| 国产波多野结衣中文在线播放| 99爱在线观看免费完整版| 性猛交xxxxx按摩欧美| 久久亚洲国产精品123区| 最近中文字幕高清中文字幕电影二 | 免费国产人做人视频在线观看| 课外辅导的秘密在线观看| 国产欧美另类精品久久久| 6080yy三级手机理论在线| 奇米色在线视频| 三上悠亚中文字幕在线播放| 日本成人在线免费| 五月天国产视频| 欧美亚洲日本视频| 亚洲成人免费网站| 波多野结衣在线不卡| 免费专区丝袜脚调教视频| 精品日韩在线视频| 国产av午夜精品一区二区入口 | 精品国产亚洲第一区二区三区| 国产中文欧美日韩在线| 麻豆精品一区二区综合av| 国产欧美日韩va| 五月天婷婷精品视频| 国产精品亚洲精品爽爽| 91av手机在线观看| 国自产拍在线天天更新91| gogo全球高清大胆亚洲| 妞干网免费观看视频| 一级性生活毛片| 性一交一乱一乱一视频| 中国老人倣爱视频| 成人毛片免费播放| 中文字幕免费在线观看动作大片| 无码精品日韩中文字幕|