cisco交換機常用操作項

交換機的常用操作項

l      交換機的三種模式
用戶模式:查看簡單的配置
特權模式:能夠進行查看和命令的操作,相當於管理員
全局配置模式:配置交換機的參數
1
、由用戶模式輸入enable、進入特權模式
2
、由特權模式進入全局配置模式輸入config terminal
3
、配置接口的ip時要進入到相應的接口中,用interface +接口

 

l      更改主機名
switch(config)#hostname A

l      設置進入特權模式的密碼
switch(config)#enable password 1234 
明文顯示
switch(config)#enable secret cisco 
加密顯示

l      設置console口密碼
switch(config)#line console 0
switch(config-line)#password 
123
switch(config-line)#login

l      查看mac地址列表
switch#show mac-address-table

l      查看mac地址列表刷新時間
switch#show mac-address-table aging-time

l      更改mac地址列表刷新時間
switch(config)#mac-address-table aging-time 200

l      保存配置
switch#copy running-config startup-config
switch#write

l      恢復出廠默認設置
switch#erase startup-config
switch#reload
l   添加接口的描述信息
switch(config-if)# description connection to routerA

l      設置交換機的網關
switch(config)#ip default-gateway 192.168.1.1

l      關掉DNS解析
switch(config)#
no ip domain-lookup
l   將接口設爲trunk
     switch(config-if)#switchport mode trunk
l   關閉trunk
     switch(config-if)#switchpor mode access
●        配置接口爲動態協商模式
 switch(config-if)#switchport mode dynamic desirable/auto
 
l   還原接口到默認配置狀態
     switch(config-if)#default interface interface-id
l      查看當前配置(RAM
switch#show running-config

l      查看交換機的配置(NVRAM
switch#show startup-config

l      查看cdp的全局信息
switch#show cdp

l      查看接口的cdp配置信息
switch#show cdp interface f0/2

l      查看有關cdp包的統計信息
switch#show cdp traffic

l      查看鄰居信息
switch#show cdp neighbors

l      查看所有入口項的詳細信息
switch#show cdp neighbors detail
switch#show cdp entry *

l      實現交換機的遠程管理
switch(config)#enable secret cisco
switch(config)#intface valn 1
switch(config-if)#ip address
192.168.1.100 255.255.255.0
switch(config-if)#no shutdown
switch(config)#line vty 0 4
switch(config-line)#password 123
switch(config-line)#login
c:\>telnet 192.168.1.100

l      交換機的密碼恢復
1
、將交換機的電源拔下
2
、按住mode鍵插上電源,當出現switch:時將手鬆開
3
switch:flash_init      //加載到flash
4
switch:dir flash:      //查看flash中的文件
5
rename flash:config.text  flash:config.old //更改文件名
6
boot                 //重新啓動交換機
7
rename flash:config.old  flash:config.text  //將文件名改回
8
copy flash:config.text  running-config
9
enable password  cisco            //重新設置密碼

10write                           //保存

l      創建vlan方法一
switch#vlan database
switch(vlan)#vlan  10  name  ****
switch(vlan)#exit

l      創建vlan方法二
switch(config)#vlan 10
switch(config-vlan)#name ****

l      刪除vlan方法一
switch(vlan)#no vlan 10
switch(vlan)#exit

l      刪除vlan方法二
switch(config)#no vlan 10

l      刪除vlan方法三
switch#delete vlan.dat

l      將端口加入到vlan
switch(config-if)#switchport access vlan 10

l      將一組連續的端口加入到vlan
switch(config)# interface range f0/1 – 5
switch(config-if-range)#switchport access vlan 10

l      將端口從vlan中刪除
switch(config-if)#no switchport access vlan 10
switch(config-if)#switchport access vlan 1

switch(config-if-range)#no switchport access vlan 10
switch(config-if-range)#switchport access vlan 1

l      查看所有vlan的摘要信息
switch#show vlan brief

l      查看指定vlan的信息
switch#show vlan id 10
 
        查看接口模式
      switch#show interface f0/1 switchport
●        在trunk中添加或刪除某個vlan(在trunk口中)
      switch(config-if)#switchport trunk allowed vlan add 10
      switch(config-if)#switchport trunk allowed vlan remove 10
 
 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章