按图所示设置PC的IP地址,交换机主机名。
(1)配件交换机50-1为vtp服务端并创建vlan;
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#host
Switch(config)#hostname 50-1
50-1(config)#vtp domain wgj
Changing VTP domain name from NULL to wgj
50-1(config)#vtp mode server
Device mode already VTP SERVER.
50-1(config)#vlan 10
50-1(config-vlan)#vlan 20
50-1(config-vlan)#exit
50-1(config)#
(2)配件交换机50-2为vtp客户端;
Switch>
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname 50-2
50-2(config)#vtp domain wgj
Changing VTP domain name from NULL to wgj
50-2(config)#vtp mode client
Setting device to VTP CLIENT mode.
50-2(config)#
使用show vlan命令检验vtp中继的结果,发现并没有创建vlan;(思考问题出在哪里?)
(3)配件交换机50-3为vtp客户端,使用show vlan命令检验vtp中继的结果,同样发现并没有创建vlan;
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname 50-3
50-3(config)#vtp domain wgj
Changing VTP domain name from NULL to wgj
50-3(config)#vtp mode client
Setting device to VTP CLIENT mode.
50-3(config)#
(1)配置交换机50-1
50-1(config)#interface range gigabitEthernet 0/1-2
50-1(config-if-range)#channel-group 1 mode on
50-1(config-if-range)#
Creating a port-channel interface Port-channel 1
%LINK-5-CHANGED: Interface Port-channel 1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel 1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up
50-1(config-if-range)#exit
50-1(config)#interface port-channel 1
50-1(config-if)#switchport mode trunk
50-1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel 1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel 1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up
50-1(config-if-range)#switchport trunk allowed vlan all
50-1(config-if)#exit
50-1(config)#interface fastEthernet 0/24
50-1(config-if)#switchport mode trunk
50-1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up
50-1(config-if)#switchport trunk allowed vlan all
50-1(config-if)#exit
50-1(config)#
使用show vlan命令检验vtp中继的结果,发现创建了vlan,问题解决;
50-1(config)#spanning-tree mode rapid-pvst
50-2(config)#spanning-tree mode rapid-pvst
50-3(config)#spanning-tree mode rapid-pvst
(1)设置交换机50-1为Vlan 10的根网桥,为Vlan 20的备用。
50-1(config)#spanning-tree vlan 10 priority 4096
50-1(config)#spanning-tree vlan 20 root secondary
(2)设置交换机50-2为Vlan 20的根网桥,为Vlan 10的备用。
50-2(config)#spanning-tree vlan 20 priority 4096
50-2(config)#spanning-tree vlan 10 root secondary
50-1(config-if)#spanning-tree vlan 10 Port-priority 112