注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 科普系列之-使用Windows的..
 帮助

每valn生成树负载均衡


2007-05-20 10:31:15
 标签:交换   [推送到技术圈]

版权声明:原创作品,谢绝转载!否则将追究法律责任。
valn生成树负载均衡
实验目标:
在本实验中,使用Cisco IOS命令调整生成树默认行为进行vlan负载均衡。
实验拓扑:
场景
已经安装了两个分布层和两个接入层交换机。网络管理员希望确保接入层交换机不会成为生成树的根网桥。分布层交换机来承担这一功能。网络管理员还希望提供每vlan负载均衡。sw1 需要成为vlan10的根,sw2需要成为vlan20的根。
网络设计表如下:
                  网络设计表
Catalyst类型
交换机
VTP
VTP模式
3550
    SW1
  CISCO
服务器
3550
    SW2
  CISCO
  客户端
    2950
    SW3
  CISCO
客户端
    2950
    SW4
  CISCO
客户端
 Vlan配置信息如下表:
VLAN ID
VLAN
Vlan子网
SW1
SW2
SW3
SW4
   1
 本地
172.16.1.0/24
Fa0/1-10
Fa0/1-10
Fa0/1-4
Fa0/13-24
Fa0/1-4
Fa0/13-24
   10
 V10
172.16.10.0/24
Fa0/11-20
Fa0/11-20
Fa0/5-8
Fa0/5-8
   20
V20
172.16.20.0/24
Fa0/21-24
Fa0/21-24
Fa0/9-12
Fa0/9-12
 Trunk
 
802.1Q
802.1Q
802.1Q
802.1Q
802.1Q
步骤1
  删除交换机配置和vlan.dat文件并重启设备,按照实验拓扑图连接实验的线缆。
在所有交换机上使用show spsnning-tree观察默认行为
SW1
sw1#show spanning-tree
 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0009.43bf.4f00
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
 
  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0009.43bf.4f00
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300
 
Interface        Port ID                     Designated                Port ID
Name             Prio.Nbr      Cost Sts      Cost Bridge ID            Prio.Nbr
---------------- -------- --------- --- --------- -------------------- --------
Fa0/1            128.1           19 FWD         0 32769 0009.43bf.4f00 128.1
Fa0/3            128.3           19 FWD         0 32769 0009.43bf.4f00 128.3
SW2
sw2#show spanning-tree
 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0009.43bf.4f00
             Cost        38
             Port        3 (FastEthernet0/3)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
 
  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0009.43f6.b780
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300
 
Interface        Port ID                     Designated                Port ID
Name             Prio.Nbr      Cost Sts      Cost Bridge ID            Prio.Nbr
---------------- -------- --------- --- --------- -------------------- --------
Fa0/1            128.1           19 BLK        19 32769 000c.857e.a880 128.3
Fa0/3            128.3           19 FWD        19 32769 0009.b7de.26c0 128.3
SW3
sw3#show spanning-tree
 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0009.43bf.4f00
             Cost        19
             Port        1 (FastEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
 
  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     000c.857e.a880
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300
 
Interface        Port ID                     Designated                Port ID
Name             Prio.Nbr      Cost Sts      Cost Bridge ID            Prio.Nbr
---------------- -------- --------- --- --------- -------------------- --------
Fa0/1            128.1           19 FWD         0 32769 0009.43bf.4f00 128.1
Fa0/3            128.3           19 FWD        19 32769 000c.857e.a880 128.3
SW4
sw4#show spanning-tree
 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0009.43bf.4f00
             Cost        19
             Port        1 (FastEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
 
  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0009.b7de.26c0
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300
 
Interface        Port ID                     Designated                Port ID
Name             Prio.Nbr      Cost Sts      Cost Bridge ID            Prio.Nbr
---------------- -------- --------- --- --------- -------------------- --------
Fa0/1            128.1           19 FWD         0 32769 0009.43bf.4f00 128.3
Fa0/3            128.3           19 FWD        19 32769 0009.b7de.26c0 128.3
步骤2
     配置中继接口在交换机间创建一个中继链路。在SW1SW2上设置中继。
2950交换机不需要配置封装。这些交换机默认使用802.1Q。有些IOS版本没有其它选项。控制台连接到每个接入交换机,并配置中继:
SW1
Sw1(config)#interface range fastethernet0/1 , fastethernet0/3
Sw1(config-if-range)#switchport mode trunk
Sw1(config-if-range)#
SW2
Sw2(config)#interface range fastethernet0/1 , fastethernet0/3
Sw2(config-if-range)#switchport mode trunk
Sw2(config-if-range)#
SW3
Sw3(config)#interface range fastethernet0/1 , fastethernet0/3
Sw3(config-if-range)#switchport mode trunk
Sw3(config-if-range)#
SW4
Sw4(config)#interface range fastethernet0/1 , fastethernet0/3
Sw4(config-if-range)#switchport mode trunk
Sw4(config-if-range)#
步骤3
     控制台连接到SW1并配置VTPCISCO、服务器模式和适当的VLAN及名字:
sw1(config)#vtp domain cisco
Changing VTP domain name from test to cisco
sw1(config)#vtp mode server
Device mode already VTP SERVER.
sw1(config)#exit
sw1#vlan database
sw1(vlan)#vlan 10 name v10
VLAN 10 added:
    Name: v10
sw1(vlan)#vlan 20 name v20
VLAN 20 added:
    Name: v20
sw1(vlan)#
使用show vtp statusshow vtp counters命令检查中继配置:
sw1#show vtp status
VTP Version                     : 2
Configuration Revision          : 1
Maximum VLANs supported locally : 64
Number of existing VLANs        : 7
VTP Operating Mode              : Server
VTP Domain Name                 : cisco
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Enabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x8D 0xCD 0x2E 0x30 0x24 0x17 0x91 0xDC
Configuration last modified by 0.0.0.0 at 3-1-93 01:52:53
Local updater ID is 0.0.0.0 (no valid interface found)
 
sw1#show vtp counters
VTP statistics:
Summary advertisements received    : 8
Subset advertisements received     : 2
Request advertisements received    : 2
Summary advertisements transmitted : 17
Subset advertisements transmitted  : 8
Request advertisements transmitted : 1
Number of config revision errors   : 0
Number of config digest errors     : 0
Number of V1 summary errors        : 0
 
 
VTP pruning statistics:
 
Trunk            Join Transmitted Join Received    Summary advts received from
                                                   non-pruning-capable device
---------------- ---------------- ---------------- ---------------------------
Fa0/1               1                1                0
Fa0/3               1                0                0
sw1#
   按照下面的代码,将SW1上的各端口分配到各自的VLAN。可以使用interface range命令同时配置几个接口:
 
sw1(config)#interface range fastethernet0/11 - 20
sw1(config-if-range)#switchport mode access
sw1(config-if-range)#switchport access vlan 10
sw1(config-if-range)#exit
sw1(config)#interface range fastethernet0/21 - 24
sw1(config-if-range)#switchport access vlan 20
sw1(config-if-range)#
  按照下面的代码,配置SW2作为VTP客户,并将端口划分到各自的VLAN。可以使用interface range命令同时配置几个接口:
sw2#vlan database
sw2(vlan)#vtp client
Setting device to VTP CLIENT mode.
sw2(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
sw2#config t
Enter configuration commands, one per line.  End with CNTL/Z.
sw2(config)#vtp domain cisco
sw2(config)#interface range fastethernet0/11 - 20
sw2(config-if-range)#switchport mode access
sw2(config-if-range)#switchport access vlan 10
sw2(config-if-range)#exit
sw2(config)#interface range fastethernet0/21 - 24
sw2(config-if-range)#switchport access vlan 20
sw2(config-if-range)#^Z
sw2#
步骤4
按照下图,配置SW3SW4作为VTP客户。并在每个交换机上将端口划分到各自的VLAN。可以使用interface range命令同时配置几个接口:
sw3#config t
Enter configuration commands, one per line.  End with CNTL/Z.
sw3(config)#vtp mode client
Device mode already VTP CLIENT.
sw3(config)#vtp domain cisco
Changing VTP domain name from ciaco to cisco
sw3(config)#interface range fastethernet0/5 - 8
sw3(config-if-range)#switchport mode access
sw3(config-if-range)#switchport access vlan 10
sw3(config-if-range)#exit
sw3(config)#interface range fastethernet0/9 - 12
sw3(config-if-range)#switchport access vlan 20
sw3(config-if-range)#^Z
sw3#
sw4#config t
Enter configuration commands, one per line.  End with CNTL/Z.
sw4(config)#vtp mode client
Device mode already VTP CLIENT.
sw4(config)#vtp domain cisco
Domain name already set to cisco.
sw4(config)#interface range fastethernet 0/5 - 8
sw4(config-if-range)#switchport mode access
sw4(config-if-range)#switchport access vlan 10
sw4(config-if-range)#exit
sw4(config)#interface range fastethernet 0/9 - 12
sw4(config-if-range)#switchport access vlan 20
sw4(config-if-range)#^Z
sw4#
控制台连接到每个交换机,使用show vtp statusshow vlan命令检查VTPVLAN 配置
SW1
sw1#show vtp status