Switch(config-if)#Switchport mode access 设成静态VLAN访问模式
Switch(config-if)#Switchport access vlan 3 将此口分给VLAN3
Switch(config-if)#exit
===================
配置1号光口为VLAN-2
Switch(config)#interface GigabitEthernet 0/1 进入G0/1
Switch(config-if)#Switchport mode access 设成静态VLAN访问模式
Switch(config-if)#Switchport access vlan 2 将此口分给VLAN2
Switch(config-if)#exit
===================
配置2号光口为VLAN-3
Switch(config)#interface GigabitEthernet 0/2 进入G0/2
Switch(config-if)#Switchport mode access 设成静态VLAN访问模式
Switch(config-if)#Switchport access vlan 3 将此口分给VLAN3
Switch(config-if)#exit
Switch(config)#exit
十、关闭VLAN1:
Switch#configure terminal 进入配置子模式
Switch(config)#interface vlan 1 配置VLAN1
Switch(config-if)#shutdown 关闭VLAN1
Switch(config-if)#exit
Switch(config)#exit
Switch#show interface fastethernet0/1 status 查看F0/1网口状态
Switch#show interface fastethernet0/1 查看F0/1网口详细配置
Switch#show running-config 查看全局配置
十一、配置默认网关:
Switch#configure terminal 进入配置子模式
Switch(config)#ip default-gateway 133.37.125.4
Switch(config)#exit
十二、设置使可以远程telnet登陆:
Switch#configure terminal 进入配置子模式
Switch(config)#line vty 0 4
Switch(config-line)#password cisco
Switch(config-line)#login
Switch(config-line)#exit
Switch(config)#exit
十三、保存当前配置:
Switch#copy running-config startup-config
Destination filename [startup-config]?回车
片刻后出现:
Building configuration...
[OK]
表示当前配置保存成功 。
十四、交换机配置情况图示:
配置完成,目前整个交换机配置情况如下:

文章插图
十五、其它相关知识:
1、交换机与交换机/路由器间级联通信:
当级联的设备端口设置了trunk或划分了VLAN等情况,可能需要修改级联端口的工作模式为trunk模式才能实现相互之间的通信 。
如果是与电口级联,可以修改1号网口为trunk工作模式,使用该接口进行级联:
Switch#configure terminal 进入配置子模式
Switch(config)#interface fastethernet0/1 进入F0/1口
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk 设成TRUNK口
Switch(config-if)#switchport trunk allowed vlan all 允许所有VLAN从此口通过
Switch(config-if)#exit
Switch(config)#exit
2、如果是与光纤接口级联,可以修改1号光纤接口为trunk工作模式,使用该接口进行级联:
Switch#configure terminal 进入配置子模式
Switch(config)#interface GigabitEthernet 0/1 进入G0/1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk 设成TRUNK口
Switch(config-if)#switchport trunk allowed vlan all 允许所有VLAN从此口通过
Switch(config-if)#exit
Switch(config)#exit
执行后请按照第13步中的描述保存当前配置 。
3、WEB方式检查交换机状态:
如果需要对交换机的状态进行实施查看,可以通过URL:http://192.168.1.5 或 http://133.37.125.5
账号:admin
密码:cisco
登陆后进行查看 。
4、恢复交换机出厂设置:
Switch>en 进入特权模式
Switch#write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]回车
[OK]
Erase of nvram: complete
00:36:19: %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
Switch# reload
Proceed with reload? [confirm]回车
推荐阅读
- 一百克锅包肉有几块
- 简述一下仓颉造字
- 关于雪景的优美句子
- qq恢复官方网站二维码扫不了解决方法
- 母泰迪也会抱腿吗
- 用Fireworks制作精美的网页文字特效
- 元认知系统运作主要包括哪些内容
- 碱面条怎么做好吃
- 二建报名时间一年几次