实验环境配置说明:
1.将R1的Fa0/1接口的IP设为:10.0.0.2/8,Fa0/2接口的IP设为:20.0.0.1/8
2.将SW2的Fa0/10接口的IP设为:10.0.0.1/8
3.将vlan2的IP设为:192.168.1.1/24
4.将vlan3的IP设为:192.168.2.1/24
5.将pc1的IP设为:192.168.1.10/24 网关:192.168.1.1
6.将pc2的IP设为:192.168.2.10/24 网关:192.168.2.1
7.将pc3的IP设为:192.168.1.20/24 网关:192.168.1.1
8.将pc4的IP设为:192.168.2.20/24 网关:192.168.2.1
9.将pc5的IP设为:20.0.0.2/8 网关:20.0.0.1
实验结果要求:
pc5能ping通pc1,pc2,pc3,pc4.
==========================SW1配置=================================
SW1(config)#interface range f0/1 -2
SW1(config-if-range)#switchport mode trunk
SW1(config)#interface range f0/13 -14
SW1(config-if-range)#switchport mode trunk
SW1(config)#vtp domain leaf //创建VTP域名
SW1#vlan database
SW1(vlan)#vlan 2
VLAN 2 added:
Name: VLAN0002
SW1(vlan)#vlan 3
VLAN 3 added:
Name: VLAN0003
SW1(vlan)#exit
SW1(config)#spanning-tree vlan 2 root primary //设置SW1为vlan2的主根网桥
VLAN 2 bridge priority set to 8192
VLAN 2 bridge max aging time unchanged at 20
VLAN 2 bridge hello time unchanged at 2
VLAN 2 bridge forward delay unchanged at 15
SW1(config)#spanning-tree vlan 3 root secondary //设置SW1为vlan3的辅助根网桥
VLAN 3 bridge priority set to 16384
VLAN 3 bridge max aging time unchanged at 20
VLAN 3 bridge hello time unchanged at 2
VLAN 3 bridge forward delay unchanged at 15
SW1(config)#interface range f0/1 -2 //配置以太网通道
SW1(config-if-range)#shutdown
SW1(config-if-range)#channel-group 1 mode on
SW1(config-if-range)#no shutdown
SW1(config)#ip routing //开启三层交换路由功能
=============================SW2配置==========================
SW2(config)#interface range f0/1 -2
SW2(config-if-range)#switchport mode trunk
SW2(config)#interface range f0/13 -14
SW2(config-if-range)#switchport mode trunk
SW2(config)#interface f0/10
SW2(config-if)#switchport mode trunk
SW2(config)#VTP mode client //设置SW3为VTP客户机模式
SW2(config)#spanning-tree vlan 3 root primary //设置SW2为vlan3的主根网桥
VLAN 3 bridge priority set to 8192
VLAN 3 bridge max aging time unchanged at 20
VLAN 3 bridge hello time unchanged at 2
VLAN 3 bridge forward delay unchanged at 15
SW2(config)#spanning-tree vlan 2 root secondary //设置SW2为vlan2的辅助根网桥
VLAN 2 bridge priority set to 16384
VLAN 2 bridge max aging time unchanged at 20
VLAN 2 bridge hello time unchanged at 2
VLAN 2 bridge forward delay unchanged at 15
责任编辑:小草