分类: 系统运维
2008-05-20 15:58:04
[page]
port channel 与 Spanning tree连接的区别
bluestudy_a(config)#interface fastEthernet 0/1
bluestudy_a(config-if)#port group 2
bluestudy_a(config-if)#
bluestudy_a(config)#interface fastEthernet 0/2
bluestudy_a(config-if)#port group 2
bluestudy_a(config-if)#
bluestudy_b(config)#interface fastEthernet 0/23
bluestudy_b(config-if)#port group 2
bluestudy_b(config-if)#
bluestudy_b(config)#interface fastEthernet 0/24
bluestudy_b(config-if)#port group 2
bluestudy_a(config-if)#
这时在bluestudy_a与bluestudy_b之间连接的两条双较线的端口灯均是绿色,表示二者传输数据正常。
现在我将双方之间的channel配置去掉
bluestudy_a(config)#interface fastEthernet 0/1
bluestudy_a(config-if)#no port group 2
bluestudy_a(config-if)#
bluestudy_a(config)#interface fastEthernet 0/2
bluestudy_a(config-if)#no port group 2
bluestudy_a(config-if)#
bluestudy_b(config)#interface fastEthernet 0/23
bluestudy_b(config-if)#no port group 2
bluestudy_b(config-if)#
bluestudy_b(config)#interface fastEthernet 0/24
bluestudy_b(config-if)#no port group 2
bluestudy_a(config-if)#
然后打开Spanning tree
bluestudy_a(config)#spanning-tree vlan 1
bluestudy_a(config)#
bluestudy_b(config)#spanning-tree vlan 1
bluestudy_b(config)#
在交换机b上查看Spanning tree状态
bluestudy_b#show spanning-tree vlan 1
Spanning tree 1 is executing the IEEE compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address 0006.d74f.6700
Configured hello time 2, max age 20, forward delay 15
Current root has priority 32768, address 0006.5329.cd80
Root port is 13, cost of root path is 19
Topology change flag not set, detected flag not set, changes 30
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 0, topology change 0, notification 0
Interface Fa0/1 (port 13) in Spanning tree 1 is FORWARDING
Port path cost 19, Port priority 128
Designated root has priority 32768, address 0006.5329.cd80
Designated bridge has priority 32768, address 0006.5329.cd80
Designated port is 37, path cost 0
Timers: message age 1, forward delay 0, hold 0
BPDU: sent 2, received 358
Interface Fa0/2 (port 14) in Spanning tree 1 is BLOCKING
Port path cost 19, Port priority 128
Designated root has priority 32768, address 0006.5329.cd80
Designated bridge has priority 32768, address 0006.5329.cd80
Designated port is 38, path cost 0
Timers: message age 0, forward delay 0, hold 0
BPDU: sent 1, received 351
Interface Fa0/3 (port 15) in Spanning tree 1 is down
Port path cost 100, Port priority 128
Designated root has priority 32768, address 0006.5329.cd80
Designated bridge has priority 32768, address 0006.d74f.6700
Designated port is 15, path cost 19
Timers: message age 0, forward delay 0, hold 0
BPDU: sent 1, received 0
在交换机a上查看Spanning tree状态
bluestudy_b#show spanning-tree vlan 1
Interface Fa0/23 (port 37) in Spanning tree 1 is FORWARDING
Port path cost 19, Port priority 128
Designated root has priority 150, address 0006.d74f.6700
Designated bridge has priority 150, address 0006.d74f.6700
Designated port is 13, path cost 0
Timers: message age 4, forward delay 0, hold 0
BPDU: sent 453, received 119
Interface Fa0/24 (port 38) in Spanning tree 1 is BLOCKING
Port path cost 19, Port priority 128
Designated root has priority 150, address 0006.d74f.6700
Designated bridge has priority 150, address 0006.d74f.6700
Designated port is 14, path cost 0
Timers: message age 3, forward delay 0, hold 0
BPDU: sent 440, received 118
结果如上:一根通一根断
[page]
对堆叠端口同样进行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)是处于激活状态的
[page]
Catalyst 3524的高级配置
VLAN的设置:
首先要进入VLAN的设置模式,有别于 5500等第三层交换机
bluestudy_a#vlan database
bluestudy_a(vlan)#
命令集如下:
bluestudy_a(vlan)#?
VLAN database editing buffer manipulation commands:
abort Exit mode without applying the changes
apply Apply current changes and bump revision number
exit Apply changes, bump revision number, and exit mode
no Negate a command or set its defaults
reset Abandon current changes and reread current database
show Show database information
vlan Add, delete, or modify values associated with a single VLAN
vtp Perform VTP administrative functions.
bluestudy_a(vlan)#
bluestudy_a(vlan)#vlan 10 name bluestudy_10
VLAN 10 added:
Name: bluestudy_10
bluestudy_a(vlan)#
bluestudy_a(vlan)#vlan 20 name bluestudy_20
VLAN 20 added:
Name: bluestudy_20
bluestudy_a(vlan)#
查看VLAN定义情况:
bluestudy_a#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active 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, Fa0/15, Fa0/16,
Fa0/17, Fa0/18, Fa0/19, Fa0/20,
Fa0/21, Fa0/22, Fa0/23, Fa0/24,
Gi0/1, Gi0/2
10 bluestudy_10 active
20 bluestudy_20 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 1002 1003
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 1 1003
1003 tr