实验环境
按下图连接网络,链路均为100M链路,其中交换机设备都为默认配置。
需求描述
要求配置交换机,实现SW1成为VLAN1-2的根网桥,SW2成为VLAN3-4的根网桥,实现VLAN的负载均衡。
具体配置
SW1上的配置
Router>en 进入特权模式
Router#conf t 进入全局模式
Router(config)#ho sw1 更改设备名称
sw1(config)#no ip do lo 关闭域名解析
sw1(config)#lin 0 进入控制台
sw1(config-line)#no exec-t 关闭超时
sw1(config-line)#logg s 关闭日志同步
sw1(config-line)#int ran f0/13 -15 进入F0/13至F0/15接口
sw1(config-if-range)#sw mode trun 配置成TRUNK
sw1(config-if-range)#end 返回特权模式
sw1#vlan da 进入VLAN配置模式
sw1(vlan)#vtp domain feiniao 配置VTP域名
sw1(vlan)#vlan 2 添加VLAN2
VLAN 2 added:
Name: VLAN0002
sw1(vlan)#vlan 3 添加VLAN3
VLAN 3 added:
Name: VLAN0003
sw1(vlan)#vlan 4 添加VLAN4
VLAN 4 added:
Name: VLAN0004
sw1(vlan)#exit 保存并退出
APPLY completed.
Exiting....
sw1#conf t 进入全局模式
sw1(config)#spanning-tree vlan 1 pri 4096 更改VLAN1的优先级
sw1(config)#spanning-tree vlan 2 pri 4096 更改VLAN2的优先级
sw1(config)#spanning-tree vlan 3 pri 8192 更改VLAN3的优先级
sw1(config)#spanning-tree vlan 4 pri 8192 更改VLAN4的优先级
sw1(config)#end 返回特权模式
SW2上的配置
Router>en 进入特权模式
Router#conf t 进入全局模式
Router(config)#ho sw2 更改设备名称
sw2(config)#no ip do lo 关闭域名解析
sw2(config)#lin 0 进入控制台
sw2(config-line)#no exec-t 关闭超时
sw2(config-line)#logg s 关闭日志同步
sw2(config-line)#int ran f0/13 -15 进入F0/13至F0/15
sw2(config-if-range)#sw mode trun 配置成TRUNK
sw2(config-if-range)#end 返回特权模式
sw2#show vlan-s b 查看VLAN信息
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/0, Fa0/1, Fa0/2, Fa0/3
Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12
2 VLAN0002 active
3 VLAN0003 active
4 VLAN0004 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
sw2#conf t 进入全局模式模式
sw2(config)#spanning-tree vlan 1 pri 8192 更改VLAN1优先级
sw2(config)#spanning-tree vlan 2 pri 8192 更改VLAN2优先级
sw2(config)#spanning-tree vlan 3 pri 4096 更改VLAN3优先级
sw2(config)#spanning-tree vlan 4 pri 4096 更改VLAN4优先级
sw2(config)#end 返回特权模式
SW3上的配置
Router>en 进入特权模式
Router#conf t 进入全局模式
Router(config)#ho sw3 更改设备名称
sw3(config)#no ip do lo 关闭域名解析
sw3(config)#lin 0 进入控制台
sw3(config-line)#no exec-t 关闭超时
sw3(config-line)#logg s 关闭日志同步
sw3(config-line)#int ran f0/14 -15 进入F0/14至F0/15接口
sw3(config-if-range)#sw mode trun 配置成TRUNK
sw3(config-if-range)#end 返回特权模式
sw3#show vlan-s b 查看VLAN信息
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/0, Fa0/1, Fa0/2, Fa0/3
Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13
2 VLAN0002 active
3 VLAN0003 active
4 VLAN0004 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
sw3#
SW4上的配置
Router>en 进入特权模式
Router#conf t 进入全局模式
Router(config)#ho sw4 更改设备名称
sw4(config)#no ip do lo 关闭域名解析
sw4(config)#lin 0 进入控制台
sw4(config-line)#no exec-t 关闭超时
sw4(config-line)#logg s 关闭日志同步
sw4(config-line)#int ran f0/14 -15 进入F0/14至F0/15接口
sw4(config-if-range)#sw mode trun 配置成中继
sw4(config-if-range)#end 返回特权模式
sw4#show vlan-s b 查看VLAN信息
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/0, Fa0/1, Fa0/2, Fa0/3
Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
sw4#
验证结果
sw1#show spanning-tree brief
VLAN1
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address cc00.0f90.0000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4096
Address cc00.0f90.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/13 128.14 128 19 FWD 0 4096 cc00.0f90.0000 128.14
FastEthernet0/14 128.15 128 19 FWD 0 4096 cc00.0f90.0000 128.15
FastEthernet0/15 128.16 128 19 FWD 0 4096 cc00.0f90.0000 128.16
VLAN2
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address cc00.0f90.0001
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4096
Address cc00.0f90.0001
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/13 128.14 128 19 FWD 0 4096 cc00.0f90.0001 128.14
FastEthernet0/14 128.15 128 19 FWD 0 4096 cc00.0f90.0001 128.15
FastEthernet0/15 128.16 128 19 FWD 0 4096 cc00.0f90.0001 128.16
VLAN3
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address cc00.0630.0002
Cost 19
Port 16 (FastEthernet0/15)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 8192
Address cc00.0f90.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/13 128.14 128 19 FWD 19 8192 cc00.0f90.0002 128.14
FastEthernet0/14 128.15 128 19 FWD 19 8192 cc00.0f90.0002 128.15
FastEthernet0/15 128.16 128 19 FWD 0 4096 cc00.0630.0002 128.16
VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address cc00.0630.0003
Cost 19
Port 16 (FastEthernet0/15)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 8192
Address cc00.0f90.0003
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/13 128.14 128 19 FWD 19 8192 cc00.0f90.0003 128.14
FastEthernet0/14 128.15 128 19 FWD 19 8192 cc00.0f90.0003 128.15
FastEthernet0/15 128.16 128 19 FWD 0 4096 cc00.0630.0003 128.16
sw1#
sw2#show spanning-tree brief
VLAN1
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address cc00.0f90.0000
Cost 19
Port 16 (FastEthernet0/15)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 8192
Address cc00.0630.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/13 128.14 128 19 FWD 19 8192 cc00.0630.0000 128.14
FastEthernet0/14 128.15 128 19 FWD 19 8192 cc00.0630.0000 128.15
FastEthernet0/15 128.16 128 19 FWD 0 4096 cc00.0f90.0000 128.16
VLAN2
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address cc00.0f90.0001
Cost 19
Port 16 (FastEthernet0/15)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 8192
Address cc00.0630.0001
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/13 128.14 128 19 FWD 19 8192 cc00.0630.0001 128.14
FastEthernet0/14 128.15 128 19 FWD 19 8192 cc00.0630.0001 128.15
FastEthernet0/15 128.16 128 19 FWD 0 4096 cc00.0f90.0001 128.16
VLAN3
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address cc00.0630.0002
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4096
Address cc00.0630.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/13 128.14 128 19 FWD 0 4096 cc00.0630.0002 128.14
FastEthernet0/14 128.15 128 19 FWD 0 4096 cc00.0630.0002 128.15
FastEthernet0/15 128.16 128 19 FWD 0 4096 cc00.0630.0002 128.16
VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address cc00.0630.0003
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4096
Address cc00.0630.0003
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/13 128.14 128 19 FWD 0 4096 cc00.0630.0003 128.14
FastEthernet0/14 128.15 128 19 FWD 0 4096 cc00.0630.0003 128.15
FastEthernet0/15 128.16 128 19 FWD 0 4096 cc00.0630.0003 128.16
sw2#
评论列表: