Set the port Ethernet0/0/3 access vlan 100 successfully
Set the port Ethernet0/0/4 access vlan 100 successfully
Set the port Ethernet0/0/5 access vlan 100 successfully
Set the port Ethernet0/0/6 access vlan 100 successfully
Set the port Ethernet0/0/7 access vlan 100 successfully
Set the port Ethernet0/0/8 access vlan 100 successfully
switch(Config-Vlan100)#exit
switch(Config)#vlan 200 !进入vlan 200
switch(Config-Vlan200)#switchport interface ethernet 0/0/9-16
!给vlan200加入端口9-16
Set the port Ethernet0/0/9 access vlan 200 successfully
Set the port Ethernet0/0/10 access vlan 200 successfully
Set the port Ethernet0/0/11 access vlan 200 successfully
Set the port Ethernet0/0/12 access vlan 200 successfully
Set the port Ethernet0/0/13 access vlan 200 successfully
Set the port Ethernet0/0/14 access vlan 200 successfully
Set the port Ethernet0/0/15 access vlan 200 successfully
Set the port Ethernet0/0/16 access vlan 200 successfully
switch(Config-Vlan200)#exit
验证配置:
switch#show vlan
VLAN Name Type Media Ports
---- ------------ ---------- --------- ----------------------------------------
1 default Static ENET Ethernet0/0/17 Ethernet0/0/18 Ethernet0/0/19 Ethernet0/0/20 Ethernet0/0/21 Ethernet0/0/22 Ethernet0/0/23 Ethernet0/0/24 100 VLAN0100 Static ENET Ethernet0/0/1 Ethernet0/0/2 Ethernet0/0/3 Ethernet0/0/4 Ethernet0/0/5 Ethernet0/0/6 Ethernet0/0/7 Ethernet0/0/8 200 VLAN0200 Static ENET Ethernet0/0/9 Ethernet0/0/10 Ethernet0/0/11 Ethernet0/0/12 Ethernet0/0/13 Ethernet0/0/14 Ethernet0/0/15 Ethernet0/0/16 第五步:配置交换机各vlan虚接口的IP地址
DCRS-5526S(Config)#int vlan 100
DCRS-5526S(Config-If-Vlan100)#ip address 192.168.2.1 255.255.255.0
DCRS-5526S(Config-If-Vlan100)#no shut
DCRS-5526S(Config-If-Vlan100)#exit
DCRS-5526S(Config)#int vlan 200
DCRS-5526S(Config-If-Vlan200)#ip address 192.168.3.1 255.255.255.0
DCRS-5526S(Config-If-Vlan200)#no shut
DCRS-5526S(Config-If-Vlan200)#exit
DCRS-5526S(Config)#
(二)配置Router-1路由器上两个接口的IP地址: