CISCO 2950交換機配置命令

CISCO 2950交換機配置命令
switch>
switch>enable
switch#
switch#vlan database(進入vlan維護模式)
switch(vlan)#vlan 2 name vlan2(給vlan 2命名爲vlan2)
switch(vlan)#vlan 4 name vlan4(給vlan 4命名爲vlan4)
switch(vlan)#exit(這裏要注意一下,要打入exit退出纔有效,不能用ctrl+z或end直接退出,因爲這麼不能使配置生效!)
switch#show vlan(查看vlan的配置,默認有vlan1)
switch#configure terminal(進入全局配置模式)
switch(config)#interface f0/1(進入fastethernet0/1接口配置模式)
switch(config-if)#switchport mode access(這步可以省略)
switch(config-if)#switchport access vlan 2(把該接口劃分到vlan2,記得vlan2之間有空格)
switch(config-if)#no shutdown(激活端口)
switch(config-if)#exit
switch(config)#interface f0/2
switch(config-if)#switchport mode access
switch(config-if)#switchport access vlan 4
switch(config-if)#no shutdown
switch(config-if)#exit
switch(config)#interface f0/3
switch(config-if)#switchport mode trunk(設置此口爲中繼模式)
switch(config-if)#no shutdown
witch(config-if)#exit(這裏可以直接用ctrl+z或end直接退出到特權模式)


二.在路由器Cisco2611上的配置(!!!單臂路由!!!)
router#configure terminal
router(config)#interface f0/0.1(進入子接口模式)
router(config-subif)#encapsulation dot1q 2(設置封裝類型爲dot1q,它是思科特有的。此外還有isl封裝,要看該設備支不支持。數字2是vlan號)
router(config-subif)#ip address 192.168.1.1 255.255.255.0
router(config-subif)#exit
router(config)#interface f0/0.2
router(config-subif)#encapsulation dot1q 4
router(config-subif)#ip address 192.168.3.1 255.255.255.0
router(config-subif)#exit
router(config)#interface f0/0
router(config-if)#no shutdown
router(config-if)#^z
router#show running-config
router#copy running-config startup-config
三.給PC1,PC2設置好IP地址,然後用ping命名令測試!
---------------------------------------------------------------------------------------------------------------------------

1、配置IP地址
      交換機要能夠被網管,必須給它標識一個管理IP地址,默認情況下CISCO交換機的VLAN 1爲管理VLAN,爲該VLAN配上IP 地址,交換機就可以被網管了。命令如下:
      a、進入全局模式: Switch#configure terminal
      b、進入VLAN 1接口模式:Switch(config)#interface vlan 1
      c、配置管理IP地址:Switch(config-if) # ip address [A.B.C.D] [mask]
      如果當前VLAN 不是管理VLAN ,只需要將上面第b處命令的vlan的號碼換成管理VLAN的號碼即可。
2、打開SNMP協議
      a、進入全局模式: Switch#configure terminal
      b、配置只讀的Community,產品默認的只讀Community名爲public
           Switch(config)#snmp-server community public ro
      c、配置可寫的Community,產品默認的可寫Community名爲private
           Switch(config)#snmp-server community private rw
3、更改SNMP的Community密碼
      a、將設備分組,並使能支持的各種SNMP版本
           Switch(config)#snmp-server group qycx123 v1
          Switch(config)#snmp-server group qycx 123 v2c
           Switch(config)#snmp-server group qycx123 v3 noauth
      b、分別配置只讀和可寫community 如:
           Switch(config)#snmp-server community qycx123 ro
           Switch(config)#snmp-server community qycx123 rw
4、保存交換機配置
           Switch#copy run start
常用命令
1、設置交換機密碼
      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
2、創建並劃分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)
3、常用調試命令
         a、顯示所有配置命令:Switch#show run
         b、顯示所有接口狀態:Switch#show ip int brief
         c、顯示所有VLAN的信息:Switch#show vlan brief

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章