您的位置:首页 > 理论基础 > 计算机网络

运用STP VTP HSRP 构建冗余的网络

2010-06-05 19:17 691 查看
备注:
  使用的是2950.所以在交换机SW1 SW2 的f 0/5 没有封装 dot1q(默认)。
  R3 没有静态路由。这个拓扑只保障了到网关的负载均衡与冗余备份。没有写连接外网。
  网络拓扑:





  配置指令:
SW1

switch > enable
switch # configure terminal
switch (config) # hostname sw1
sw1 (config) # vtp domain cisco
sw1 (config) # vtp mode server
sw1 (config) # vtp password cisco
sw1 (config) # exit
sw1 # vlan database
sw1 (vlan) # vlan 2
sw1 (vlan) # vlan 3
sw1 (vlan) # exit
sw1 # configure terminal
sw1 (config) # interface range fastethernet 0/1 - 5
sw1 (config-if) # switchport mode trunk
sw1 (config-if) # no shutdown
sw1 (config-if) # interface range fastethernet 0/3 - 4
sw1 (config-if) # channel-group 1 mode on
sw1 (config-if) # exit
sw1 (config) # spanning-tree vlan 2 root primary
sw1 (config) # spanning-tree vlan 3 root secondby
sw1 (config) # exit
sw1 #


switch > enable
switch # configure terminal
switch (config) # hostname sw1
sw1 (config) # vtp domain cisco
sw1 (config) # vtp mode server
sw1 (config) # vtp password cisco
sw1 (config) # exit
sw1 # vlan database
sw1 (vlan) # vlan 2
sw1 (vlan) # vlan 3
sw1 (vlan) # exit
sw1 # configure terminal
sw1 (config) # interface range fastethernet 0/1 - 5
sw1 (config-if) # switchport mode trunk
sw1 (config-if) # no shutdown
sw1 (config-if) # interface range fastethernet 0/3 - 4
sw1 (config-if) # channel-group 1 mode on
sw1 (config-if) # exit
sw1 (config) # spanning-tree vlan 2 root primary
sw1 (config) # spanning-tree vlan 3 root secondby
sw1 (config) # exit
sw1 #
SW2

switch > enable
switch # configure terminal
switch (config) # hostname sw 2
sw2 (config) # vtp domain cisco
sw2 (config) # vtp mode server
sw2 (config) # vtp password cisco
sw2 (config) # interface range fastethernet 0/1 - 5
sw2 (config-if) # switchport mode trunk
sw2 (config-if) # no shutdown
sw2 (config-if) # interface range fastethernet 0/3 - 4
sw2 (config-if) # channel-group 1 mode on
sw2 (config-if) # exit
sw2 (config) # spanning-tree vlan 3 root primary
sw2 (config)# spanning-tree vlan 2 root secondby
sw2 (config) # exit
sw2 #

[align=center][/align]

switch > enable
switch # configure terminal
switch (config) # hostname sw 2
sw2 (config) # vtp domain cisco
sw2 (config) # vtp mode server
sw2 (config) # vtp password cisco
sw2 (config) # interface range fastethernet 0/1 - 5
sw2 (config-if) # switchport mode trunk
sw2 (config-if) # no shutdown
sw2 (config-if) # interface range fastethernet 0/3 - 4
sw2 (config-if) # channel-group 1 mode on
sw2 (config-if) # exit
sw2 (config) # spanning-tree vlan 3 root primary
sw2 (config)# spanning-tree vlan 2 root secondby
sw2 (config) # exit
sw2 #
SW3

switch > enable
switch # configure terminal
switch (config) # hostname sw 3
sw3 (config) # vtp domain cisco
sw3 (config) # vtp mode client
sw3 (config) # vtp password cisco
sw3 (config) # interface range fastethernet 0/1 - 2
sw3 (config-if) # switchport mode trunk
sw3 (config-if) # no shutdown
sw3 (config-if) # interface fastethernet 0/3
sw3 (config-if) # switchport mode access
sw3 (config-if) # switchport access vlan 2
sw3 (config-if) # spanning-tree portfast
sw3 (config-if) # interface fastethernet 0/4
sw3 (config-if) # switchport mode access
sw3 (config-if) # switchport access vlan 3
sw3 (config-if) # spanning-tree portfast
sw3 (config-if) # exit
sw3 (config) # spanning-tree uplinkfast
sw3 (config) # spanning-tree vlan3
sw3 (config) # spanning-tree vlan2
sw3 (config) # exit
sw3 #


switch > enable
switch # configure terminal
switch (config) # hostname sw 3
sw3 (config) # vtp domain cisco
sw3 (config) # vtp mode client
sw3 (config) # vtp password cisco
sw3 (config) # interface range fastethernet 0/1 - 2
sw3 (config-if) # switchport mode trunk
sw3 (config-if) # no shutdown
sw3 (config-if) # interface fastethernet 0/3
sw3 (config-if) # switchport mode access
sw3 (config-if) # switchport access vlan 2
sw3 (config-if) # spanning-tree portfast
sw3 (config-if) # interface fastethernet 0/4
sw3 (config-if) # switchport mode access
sw3 (config-if) # switchport access vlan 3
sw3 (config-if) # spanning-tree portfast
sw3 (config-if) # exit
sw3 (config) # spanning-tree uplinkfast
sw3 (config) # spanning-tree vlan3
sw3 (config) # spanning-tree vlan2
sw3 (config) # exit
sw3 #
SW4

switch > enable
switch # configure terminal
switch (config) # hostname sw 4
sw4 (config) # vtp domain cisco
sw4 (config) # vtp mode client
sw4 (config) # vtp password cisco
sw4 (config) # interface range fastethernet 0/1 - 2
sw4 (config-if) # switchport mode trunk
sw4 (config-if) # no shutdown
sw4 (config-if) # interface fastethernet 0/3
sw4 (config-if) # switchport mode access
sw4 (config-if) # switchport access vlan 2
sw4 (config-if) # spanning-tree portfast
sw4 (config-if) # interface fastethernet 0/4
sw4 (config-if) # switchport mode access
sw4 (config-if) # switchport access vlan 3
sw4 (config-if) # spanning 每tree portfast
sw4 (config-if) # exit
sw4 (config) # spanning-tree uplinkfast
sw4 (config) # spanning-tree vlan3
sw4 (config) # spanning-tree vlan2
sw4 (config) # exit
sw4 #


switch > enable
switch # configure terminal
switch (config) # hostname sw 4
sw4 (config) # vtp domain cisco
sw4 (config) # vtp mode client
sw4 (config) # vtp password cisco
sw4 (config) # interface range fastethernet 0/1 - 2
sw4 (config-if) # switchport mode trunk
sw4 (config-if) # no shutdown
sw4 (config-if) # interface fastethernet 0/3
sw4 (config-if) # switchport mode access
sw4 (config-if) # switchport access vlan 2
sw4 (config-if) # spanning-tree portfast
sw4 (config-if) # interface fastethernet 0/4
sw4 (config-if) # switchport mode access
sw4 (config-if) # switchport access vlan 3
sw4 (config-if) # spanning 每tree portfast
sw4 (config-if) # exit
sw4 (config) # spanning-tree uplinkfast
sw4 (config) # spanning-tree vlan3
sw4 (config) # spanning-tree vlan2
sw4 (config) # exit
sw4 #
R1

router > enable
router # configure terminal
router (config) # hostname r1
r1 (config) # interface fastethernet 0/0.1
r1 (config-subif) # ip add 192.168.2.254 255.255.255.0
r1 (config-subif) # encapsulation dot1q 2
r1 (config-subif) # standby 2 ip 192.168.2.1
r1 (config-subif) # standby 2 priority 105
r1 (config-subif) # standby 2 preempet
r1 (config-subif) # standby 2 track fastethernet 0/1
r1 (config-subif) # interface fastethernet 0/0.2
r1 (config-subif) # ip add 192.168.3.254 255.255.255.0
r1 (config-subif) # encapsulation dot1q 3
r1 (config-subif) # standby 3 ip 192.168.3.1
r1 (config-subif) # standby 3 preempet
r1 (config-subif) # standby 3 track fastethernet 0/1
r1 (config-if) # interface fastethernet 0/0
r1 (config-if) # no shutdown
r1 (config-if) # interface fastethernet 0/1
r1 (config-if) # ip add 192.168.4.2 255.255.255.0
r1 (config-if) # no shutdown
r1 (config-if) # exit
r1 (config) # exit
r1 #


router > enable
router # configure terminal
router (config) # hostname r1
r1 (config) # interface fastethernet 0/0.1
r1 (config-subif) # ip add 192.168.2.254 255.255.255.0
r1 (config-subif) # encapsulation dot1q 2
r1 (config-subif) # standby 2 ip 192.168.2.1
r1 (config-subif) # standby 2 priority 105
r1 (config-subif) # standby 2 preempet
r1 (config-subif) # standby 2 track fastethernet 0/1
r1 (config-subif) # interface fastethernet 0/0.2
r1 (config-subif) # ip add 192.168.3.254 255.255.255.0
r1 (config-subif) # encapsulation dot1q 3
r1 (config-subif) # standby 3 ip 192.168.3.1
r1 (config-subif) # standby 3 preempet
r1 (config-subif) # standby 3 track fastethernet 0/1
r1 (config-if) # interface fastethernet 0/0
r1 (config-if) # no shutdown
r1 (config-if) # interface fastethernet 0/1
r1 (config-if) # ip add 192.168.4.2 255.255.255.0
r1 (config-if) # no shutdown
r1 (config-if) # exit
r1 (config) # exit
r1 #
 R2

router > enable
router # configure terminal
router (config) # hostname r2
r2 (config) # interface fastethernet 0/0.1
r2 (config-subif) # ip add 192.168.2.253 255.255.255.0
r2 (config-subif) # encapsulation dot1q 2
r2 (config-subif) # standby 2 ip 192.168.2.1
r2 (config-subif) # standby 2 preempet
r2 (config-subif) # standby 2 track fastethernet 0/1
r2 (config-subif) # interface fastethernet 0/0.2
r2 (config-subif) # ip add 192.168.3.253 255.255.255.0
r2 (config-subif) # encapsulation dot1q 3
r2 (config-subif) # standby 3 priority 105
r2 (config-subif) # standby 3 preempet
r2 (config-subif) # standby 3 ip 192.168.3.1
r2 (config-subif) # standby 3 track fastethernet 0/1
r2 (config-if) # interface fastethernet 0/0
r2 (config-if) # no shutdown
r2 (config-if) # interface fastethernet 0/1
r2 (config-if) # ip add 192.168.5.2 255.255.255.0
r2 (config-if) # no shutdown
r2 (config-if) # exit
r2 (config) # exit
r2 #


R3

router > enable
router # configure terminal
router (config) # hostname r3
r3 (config) # interface thernet 0/0
r3 (config-if) # ip add 192.168.4.1 255.255.255.0
r3 (config-if) # no shutdown
r3 (config) # interface ethernet 0/1
r3 (config-if) # ip add 192.168.5.1 255.255.255.0
r3 (config-if) # no shutdown
r3 (config-if) # exit
r3 (config) # exit
r3 #
router > enable
router # configure terminal
router (config) # hostname r2
r2 (config) # interface fastethernet 0/0.1
r2 (config-subif) # ip add 192.168.2.253 255.255.255.0
r2 (config-subif) # encapsulation dot1q 2
r2 (config-subif) # standby 2 ip 192.168.2.1
r2 (config-subif) # standby 2 preempet
r2 (config-subif) # standby 2 track fastethernet 0/1
r2 (config-subif) # interface fastethernet 0/0.2
r2 (config-subif) # ip add 192.168.3.253 255.255.255.0
r2 (config-subif) # encapsulation dot1q 3
r2 (config-subif) # standby 3 priority 105
r2 (config-subif) # standby 3 preempet
r2 (config-subif) # standby 3 ip 192.168.3.1
r2 (config-subif) # standby 3 track fastethernet 0/1
r2 (config-if) # interface fastethernet 0/0
r2 (config-if) # no shutdown
r2 (config-if) # interface fastethernet 0/1
r2 (config-if) # ip add 192.168.5.2 255.255.255.0
r2 (config-if) # no shutdown
r2 (config-if) # exit
r2 (config) # exit
r2 #
router > enable
router # configure terminal
router (config) # hostname r3
r3 (config) # interface thernet 0/0
r3 (config-if) # ip add 192.168.4.1 255.255.255.0
r3 (config-if) # no shutdown
r3 (config) # interface ethernet 0/1
r3 (config-if) # ip add 192.168.5.1 255.255.255.0
r3 (config-if) # no shutdown
r3 (config-if) # exit
r3 (config) # exit
r3 #


router > enable
router # configure terminal
router (config) # hostname r3
r3 (config) # interface thernet 0/0
r3 (config-if) # ip add 192.168.4.1 255.255.255.0
r3 (config-if) # no shutdown
r3 (config) # interface ethernet 0/1
r3 (config-if) # ip add 192.168.5.1 255.255.255.0
r3 (config-if) # no shutdown
r3 (config-if) # exit
r3 (config) # exit
r3 #
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  网络 STP VTP