首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 网页设计 | 平面设计 | 技术专题 | 电子书下载 | 教学视频 | 源码下载 | 搜索 | 博客 | 论坛
欢迎光临中国IT实验室思科频道
Google
您现在的位置: 中国IT实验室 >> Cisco >> 综合技术 >> Cisco综合 >> 正文

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

 

  备注:

  使用的是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 #

  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 #

  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 #

  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 #

上一页  [1] [2] 

【责编:Kittoy】
中国IT教育
相关产品和培训
文章评论
 友情推荐精华
 专题推荐

 ·节省成本才是“王道” VOIP案例应用…
 ·巧用网络流量 打造健康内网…
 ·无线路由器设置从入门到精通
 ·企业网管如何部署你的网络监控系统?
 ·负载均衡技术方案攻略
 ·中国IT实验室2007年技术热点盘点
 ·利用路由实现VPN的配置方法
 ·让你的局域网网速更上一层楼
 ·小命令大作用---Ping
 ·OSPF路由协议专题
 今日更新
 认证培训
 频道精选
 思科频道导航