对堆叠端口同样进行trunk封装
bluestudy_a#config t
Enter configuration commands, one per line. End with CNTL/Z.
bluestudy_a(config)#interface gigabitEthernet 0/1(此端口为堆叠端口)
bluestudy_a(config-if)#switchport mode trunk
bluestudy_a(config-if)#
bluestudy_b(config)#interface gigabitEthernet 0/1(此端口为堆叠端口)
bluestudy_b(config-if)#switchport mode trunk
bluestudy_b(config-if)#
bluestudy_c(config)#interface gigabitEthernet 0/2(此端口为堆叠端口)
bluestudy_c(config-if)#switchport mode trunk
bluestudy_c(config-if)#
bluestudy_d(config)#interface gigabitEthernet 0/2(此端口为堆叠端口)
bluestudy_d(config-if)#switchport mode trunk
bluestudy_d(config-if)#
bluestudy_e(config)#interface gigabitEthernet 0/2(此端口为堆叠端口)
bluestudy_e(config-if)#switchport mode trunk
bluestudy_e(config-if)#
对上述5台交换机相应的堆叠端口进行VLAN trunk的封装以后,各个交换机上的属于同一vlan的端口之间就可以进行完整的通讯了
在交换机bluestudy_e上定义同样的vlan 10 和20
将配有同一子网IP的PC分别连接在属于VLAN 10 或20的端口之上,即可互相连通。
bluestudy(vlan)#vlan 10 name bluestudy_10
VLAN 10 added:
Name: bluestudy_10
bluestudy(vlan)#vlan 20 name bluestudy_20
VLAN 20 added:
Name: bluestudy_20
bluestudy(vlan)#exit
APPLY completed.
Exiting....
bluestudy#
注:对于同一交换机上可以设置多个不同子网中的IP地址,但是在同一时刻只有一个IP(即一个VLAN IP)是处于激活状态的
说明: