- 论坛徽章:
- 0
|
我们以3550C48 EMI 为核心交换机
enable
configure terminal
!进入VLAN模式
3550# vlan database
! 创建一个编号为10名字为engineering 的VLAN
3550# vlan 10 name engineering
! 创建一个编号为20名字为techniqy 的VLAN
3550# vlan 20 name techniqy
另外,还有一种简单的创建VLAN方式,如下所示:
3550# conf t
3550#(config)vlan 10,20,30
!结束
End
! 保持配置:
copy running-config startup-config
将交换机端口划入VLAN
例如,要将3550交换机的端口Fa0/1-10划入engineering VLAN,端口Fa0/11-20划入techniqy VLAN
! 划入端口Fa0/1
configure terminal
3550(config)#interface fasterthernet 0/1
! 设置端口模式(access)
3550(config-if)#switchport mode access
! 配置本端口属于 VLAN10
3550(config-if)switchport access vlan 10
3550(config)#interface fasterthernet 0/2
! 设置端口模式(access)
3550(config-if)#switchport mode access
! 配置本端口属于 VLAN10
3550(config-if)switchport access vlan 10
3550(config)#interface fasterthernet 0/3
! 设置端口模式(access)
3550(config-if)#switchport mode access
! 配置本端口属于 VLAN10
3550(config-if)switchport access vlan 10
3550(config)#interface fasterthernet 0/4
! 设置端口模式(access)
3550(config-if)#switchport mode access
! 配置本端口属于 VLAN10
3550(config-if)switchport access vlan 10
3550(config)#interface fasterthernet 0/5
! 设置端口模式(access)
3550(config-if)#switchport mode access
! 配置本端口属于 VLAN10
3550(config-if)switchport access vlan 10
……………………………..
采用上面的方式把VLAN20
在核心交换机上面
!进入VLAN 10 接口
Core(config)#interface vlan 10
! 为VLAN 10 接口配置IP
Core(config-if)#ip address 1921.168.0.1 255.255.255.0
!进入VLAN 20 接口
Core(config)#interface vlan 20
! 为VLAN 20 接口配置IP
Core(config-if)#ip address 192.168.1.1 255.255.255.0
!结束
End
! 保持配置:
copy running-config startup-config |
|