划分
VLAN
,根据每个
VLAN
通过
DHCP
分配
IP
地址
一、新建立
VLAN2
并配置
switch>
en
//
进入特权模式
switch#
con
//
进入全局配置模式
switch(Config)#
vlan 2
//
建立
VLAN2
switch(Config-Vlan2)#
switchport interface ethernet 1
/
2-20
//
给
VLAN2
分配端口
switchport acc vlan 2
Set the port Ethernet1
/
2 access vlan 2 successfully
Set the port Ethernet1
/
3 access vlan 2 successfully
Set the port Ethernet1
/
4 access vlan 2 successfully
Set the port Ethernet1
/
5 access vlan 2 successfully
Set the port Ethernet1
/
6 access vlan 2 successfully
Set the port Ethernet1
/7 access vlan 2 successfully
Set the port Ethernet1
/
8 access vlan 2 successfully
Set the port Ethernet1
/9 access vlan 2 successfully
Set the port Ethernet1
/10 access vlan 2 successfully
Set the port Ethernet1
/11 access vlan 2 successfully
Set the port Ethernet1
/12 access vlan 2 successfully
Set the port Ethernet1
/13 access vlan 2 successfully
Set the port Ethernet1
/14 access vlan 2 successfully
Set the port Ethernet1
/15 access vlan 2 successfully
Set the port Ethernet1
/16 access vlan 2 successfully
Set the port Ethernet1
/17 access vlan 2 successfully
Set the port Ethernet1
/18 access vlan 2 successfully
Set the port Ethernet1
/19 access vlan 2 successfully
Set the port Ethernet1
/
20 access vlan 2 successfully
switch(Config-Vlan2)#
interface vlan 2
//
进入虚拟三层管理端口
%Jan 01 00:11:50 2001 %LINK-5-CHANGED: Interface Vlan2, changed state to UP
switch(Config-If-Vlan2)#
ip address 192.168.2.1 255.255.255.0
//
给
VLAN2
分配管理地址
switch(Config-If-Vlan2)#
~~~~~~~~~~~~~~~~~~~~~~~~vlan2
配置完毕
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
二、建立
VLAN3
并配置
switch(Config)#
vlan 3
//
建立
VLAN3
switch(Config-Vlan3)#
switchport interface ethernet 0/
0/
21-24
//
给
VLAN3
分配端口
switchport acc vlan 3
Set the port Ethernet1
/
21 access vlan 3 successfully
Set the port Ethernet1
/
22 access vlan 3 successfully