亚洲欧美精品沙发,日韩在线精品视频,亚洲Av每日更新在线观看,亚洲国产另类一区在线5

<pre id="hdphd"></pre>

  • <div id="hdphd"><small id="hdphd"></small></div>
      學習啦 > 學習電腦 > 電腦硬件知識 > 硬件知識 >

      Cisco 交換機基本配置命令有哪些重要的

      時間: 加城1195 分享

        交換機工作于OSI參考模型的第二層,即數(shù)據(jù)鏈路層。交換機內(nèi)部的CPU會在每個端口成功連接時,通過將MAC地址和端口對應,形成一張MAC表,學習交換機時候基本配置命令是必須掌握的,這篇文章主要介紹了Cisco 交換機基本配置命令,需要的朋友可以參考下

        具體介紹

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

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

        Switch>enable //進入特權模式

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

        Switch#config terminal //進入全局配置模式

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

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

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

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

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

        CISCO 2960G(config-line)#login //設置遠程telnet遠程登錄驗證

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

        2:cisco2960 VLan設置

        CISCO 2960G> enable //進入特權模式

        CISCO 2960G#vlan database //進入vlan設置

        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 //回到特權模式下

        端口設置命令:

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

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

        CISCO 2960G(config-if)#shutdown //關閉當前端口

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

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

        CISCO 2960G(config-if)#

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

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

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

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

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

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

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

        將端口加入vlan

        CISCO 2960G(config)#interface fastethernet0/1

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

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

        將多個端口加入到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 //用于查看配置后結果

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

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

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

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

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

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

        4:交換機配置IP地址

        switch(config)#interface vlan 1 //進入vlan 1

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

        switch(config)#ip default-gateway 119.167.223.254 //設置交換機的默認網(wǎng)關

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

        5: 交換機保存設置命令

        switch#write //保存配置信息

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

        6:交換機顯示命令

        特權模式下:

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

        switch#show run //顯示當前配置信息

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

        switch#show startup-config //交換機開機是自動加載的 配置文件

        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 //查看交換機vlan100的ip配置信息

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

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

        switch#config terminal //進入配置視圖模式

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

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

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

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

        8:配置交換機的snmp功能

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

        switch(config)#snmp-server trap-source FastEthernet0/3/0 //設置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(團體名) //設置管理機x.x.x.x,同時允許該管理機以團體明xxx訪問。

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

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

        9:交換機禁ping配置

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

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

        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:恢復交換機出廠設置

        思科交換機分為兩種系統(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

        另一種方法是啟動的時候按Mode進入引導模式,執(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)。

        另外一臺交換機的對應匯聚端口務必要和這里兩個匯聚口的設置一樣。

        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

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

        補充:交換機基本使用方法

        作為基本核心交換機使用,連接多個有線設備使用:網(wǎng)絡結構如下圖,基本連接參考上面的【方法/步驟1:基本連接方式 】

        作為網(wǎng)絡隔離使用:對于一些功能好的交換機,可以通過模式選擇開關選擇網(wǎng)絡隔離模式,實現(xiàn)網(wǎng)絡隔離的作用,可以只允許普通端口和UPlink端口通訊,普通端口之間是相互隔離不可以通訊的

        除了作為核心交換機(中心交換機)使用,還可以作為擴展交換機(接入交換機)來擴展網(wǎng)絡

        放在路由器上方,擴展網(wǎng)絡供應商的網(wǎng)絡線路(用于一條線路多個IP的網(wǎng)絡),連接之后不同的路由器用不同的IP連接至公網(wǎng)

        相關閱讀:交換機硬件故障常見問題

        電源故障:

        由于外部供電不穩(wěn)定,或者電源線路老化或者雷擊等原因導致電源損壞或者風扇停止,從而不能正常工作。

        由于電源緣故而導致機內(nèi)其他部件損壞的事情也經(jīng)常發(fā)生。

        如果面板上的POWER指示燈是綠色的,就表示是正常的;如果該指示燈滅了,則說明交換機沒有正常供電。

        這類問題很容易發(fā)現(xiàn),也很容易解決,同時也是最容易預防的。

        針對這類故障,首先應該做好外部電源的供應工作,一般通過引入獨立的電力線來提供獨立的電源,并添加穩(wěn)壓器來避免瞬間高壓或低壓現(xiàn)象。

        如果條件允許,可以添加UPS(不間斷電源)來保證交換機的正常供電,有的UPS提供穩(wěn)壓功能,而有的沒有,選擇時要注意。

        在機房內(nèi)設置專業(yè)的避雷措施,來避免雷電對交換機的傷害?,F(xiàn)在有很多做避雷工程的專業(yè)公司,實施網(wǎng)絡布線時可以考慮。


      Cisco 交換機基本配置命令相關文章:

      1.Cisco常用的路由器交換機配置命令

      2.思科交換機配置命令有哪些

      3.cisco2960交換機安裝配置基礎詳解

      4.交換機命令行配置與VLAN介紹

      5.cisco交換機設置

      4017295