用戶模式:查看簡單的配置
特權模式:能夠進行查看和命令的操作,相當於管理員
全局配置模式:配置交換機的參數
1、由用戶模式輸入enable、進入特權模式
2、由特權模式進入全局配置模式輸入config terminal
3、配置接口的ip時要進入到相應的接口中,用interface +接口
switch(config)#hostname A
switch(config)#enable password 1234 明文顯示
switch(config)#enable secret cisco 加密顯示
switch(config)#line console 0
switch(config-line)#password 123
switch(config-line)#login
switch#show mac-address-table
switch#show mac-address-table aging-time
switch(config)#mac-address-table aging-time 200
switch#copy running-config startup-config
switch#write
switch#erase startup-config
switch#reload
switch(config-if)# description connection to routerA
switch(config)#ip default-gateway 192.168.1.1
switch(config)# no ip domain-lookup
switch#show running-config
switch#show startup-config
switch#show cdp
switch#show cdp interface f0/2
switch#show cdp traffic
switch#show cdp neighbors
switch#show cdp neighbors detail
switch#show cdp entry *
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
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 //重新設置密碼
10、write //保存
switch#vlan database
switch(vlan)#vlan 10 name ****
switch(vlan)#exit
switch(config)#vlan 10
switch(config-vlan)#name ****
switch(vlan)#no vlan 10
switch(vlan)#exit
switch(config)#no vlan 10
switch#delete vlan.dat
switch(config-if)#switchport access vlan 10
switch(config)# interface range f0/1 – 5
switch(config-if-range)#switchport access vlan 10
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
switch#show vlan brief
switch#show vlan id 10