码迷,mamicode.com
首页 > 其他好文 > 详细

华为设备stp 、vrrp的实力应用

时间:2018-01-24 17:59:08      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:proc   ospf   环路   family   技术   华为   red   默认   备份   

实验名称:华为设备stp 、vrrp的实力应用

实验拓扑:

技术分享图片

技术分享图片

实验目的:1.熟练地应用stp、vrrp的应用及配置

          2.了解环路以及解决方案

          3.使全网互通

实验思路:首先把拓扑图分为三个部分

          1.配置相同vlan相通,相同网段看交换,先配置交换机,左右两边各有三个交换机,所有会有环路,就要用到stp ,把sw2,3配置为根网桥,所有交换流量都要通过他俩:    配置命令:stp root primary

其他两个交换机配置stp,实现负载均衡,以及备份链路

  [sw]stp region-configuration

[sw-mst-region]region-name haha

    

[sw-mst-region]instance 1 vlan 10 

[sw-mst-region]instance 2 vlan 20     

[sw-mst-region]active region-configuration

[sw]stp instance 1 priority 4096

[sw]stp instance 2 priority 8192

交换机与交换机之间用trunk链接

2. 在配置第二部分,不同网段用路由。

 三个路由器都要使用的情况下,要实现冗余,就用vrrp协议配置优先级

配置命令:

R1

vrrp vrid 10 virtual-ip 192.168.10.250 创建虚拟网关

vrrp vrid 10 priority 150    配置优先级为150,默认100

vrrp vrid10 interface gi 0/0/2 reduce 100 

配置链路跟踪,当interface gi0/0/2 端口为down时,优先级减100

 R2

vrrp vrid 10 virtual-ip 192.168.10.250

vrrp vrid 10 priority 100

R3

vrrp vrid 10 virtual-ip 192.168.10.250

vrrp vrid 10 priority 80

3.配置第三部分

 交换机端口开启

 R4 

配置ip interface gi0/0/0   0/0/1

配置步骤:

设备ip网关子网掩码
pc1192.168.10.1192.168.10.250255.255.255.0
pc2192.168.20.1192.168.20.250255.255.255.0
pc3192.168.10.2192.168.10.250255.255.255.0
pc4192.168.20.2192.168.20.250255.255.255.0
服务器192.168.30.1192.168.30.254255.255.255.0
R1-0/0/0192.168.10.254
255.255.255.0
R1-0/0/1192.168.20.254
255.255.255.0
R1-0/0/2192.168.100.1
255.255.255.0
R1-虚拟ip192.168.10.250

R1-虚拟ip192.168.20.250

R2-0/0/0192.168.10.253
255.255.255.0
R2-0/0/1192.168.20.253
255.255.255.0
R2-0/0/2192.168.100.1
255.255.255.0
R2-虚拟ip192.168.10.250

R2-虚拟ip192.168.20.250

R3-0/0/0192.168.10.252
255.255.255.0
R3-0/0/1192.168.20.252
255.255.255.0
R3-0/0/2192.168.100.1
255.255.255.0
R3-虚拟ip192.168.10.250

R3-虚拟ip192.168.20.250

R4-0/0/0192.168.100.2
255.255.255.0
R4-0/0/1192.168.30.254
255.255.255.0

第一部分

技术分享图片技术分享图片

sw4 

interface gi0/0/1 :port link-tyde access

             port default vlan 10

interface gi0/0/2 :port link-tyde trunk

             port trunk allow-pass vlan all

interface gi0/0/3 :port link-tyde trunk 

             port trunk allow-pass vlan all

 [sw4]stp region-configuration

[sw4-mst-region]region-name haha

    

[sw4-mst-region]instance 1 vlan 10 

[sw4-mst-region]instance 2 vlan 20     

[sw4-mst-region]active region-configuration

[sw4]stp instance 1 priority 4096

[sw4]stp instance 2 priority 8192

sw5

interface gi0/0/1 :port link-tyde access

             port default vlan 20

interface gi0/0/2 :port link-tyde trunk

             port trunk allow-pass vlan all

interface gi0/0/3 :port link-tyde trunk 

             port trunk allow-pass vlan all

 [sw5]stp region-configuration

[sw5-mst-region]region-name haha

    

[sw5-mst-region]instance 1 vlan 10 

[sw5-mst-region]instance 2 vlan 20     

[sw5-mst-region]active region-configuration

[sw5]stp instance 1 priority 8192

[sw5]stp instance 2 priority 4096

sw2

interface gi0/0/1 :port link-tyde trunk

             port trunk allow-pass vlan all

interface gi0/0/2 :port link-tyde trunk 

             port trunk allow-pass vlan all

interface gi0/0/3 :port link-tyde access

             port default vlan 10

interface gi0/0/4 :port link-tyde access

             port default vlan 10

interface gi0/0/5 :port link-tyde access

             port default vlan 10

interface gi0/0/6 :port link-tyde trunk

             port trunk allow-pass vlan all

sw2:stp root primary 



技术分享图片

技术分享图片

sw6 

interface gi0/0/1 :port link-tyde access

             port default vlan 10

interface gi0/0/2 :port link-tyde trunk

             port trunk allow-pass vlan all

interface gi0/0/3 :port link-tyde trunk 

             port trunk allow-pass vlan all

 [sw6]stp region-configuration

[sw6-mst-region]region-name haha  

[sw6-mst-region]instance 1 vlan 10 

[sw6-mst-region]instance 2 vlan 20     

[sw6-mst-region]active region-configuration

[sw6]stp instance 1 priority 4096

[sw6]stp instance 2 priority 8192

sw7

interface gi0/0/1 :port link-tyde access

             port default vlan 20

interface gi0/0/2 :port link-tyde trunk

             port trunk allow-pass vlan all

interface gi0/0/3 :port link-tyde trunk 

             port trunk allow-pass vlan all

 [sw7]stp region-configuration

[sw7-mst-region]region-name haha

    

[sw7-mst-region]instance 1 vlan 10 

[sw7-mst-region]instance 2 vlan 20     

[sw7-mst-region]active region-configuration

[sw7]stp instance 1 priority 8192

[sw7]stp instance 2 priority 4096

sw3

interface gi0/0/1 :port link-tyde trunk

             port trunk allow-pass vlan all

interface gi0/0/2 :port link-tyde trunk 

             port trunk allow-pass vlan all

interface gi0/0/3 :port link-tyde access

             port default vlan 20

interface gi0/0/4 :port link-tyde access

             port default vlan 20

interface gi0/0/5 :port link-tyde access

             port default vlan 10

interface gi0/0/6 :port link-tyde trunk

             port trunk allow-pass vlan all

sw3:stp root primary

验证:

 

pc1 ping pc3

技术分享图片

pc2 ping pc4

技术分享图片

第二部分

技术分享图片技术分享图片

R1

   interface gi  0/0/0 :ip addess 192.168.10.254 255.255.255.0

                     vrrp vrid 10 virtual-ip 192.168.10.250

                     vrrp vrid 10 priority 150

       vrrp vrid 10 track interface GigabitEthernet0/0/2 reduced 100

  interface gi  0/0/1 :ip addess 192.168.20.252 255.255.255.0

                                  vrrp vrid 20 virtual-ip 192.168.20.250

                    vrrp vrid 10 priority 80

   interface gi  0/0/2 :ip addess 192.168.100.1   255.255.255.0

ospf 1 router-id 1.1.1.1

 area 0.0.0.0

  network 192.168.10.0 0.0.0.255

  network 192.168.20.0 0.0.0.255

 area 0.0.0.30

  network 192.168.100.0 0.0.0.255

R2

 interface gi  0/0/0 :ip addess 192.168.10.253 255.255.255.0

                   vrrp vrid 10 virtual-ip 192.168.10.250

                                 vrrp vrid 10 priority 100

vrrp vrid 10 track interface GigabitEthernet0/0/2 reduced 50

   interface gi  0/0/1 :ip addess 192.168.20.253 255.255.255.0

                                  vrrp vrid 20 virtual-ip 192.168.20.250

                    vrrp vrid 10 priority 100

 vrrp vrid 20 track interface GigabitEthernet0/0/2 reduced 50

   interface gi  0/0/2 :ip addess 192.168.100.1   255.255.255.0

ospf 1 router-id 2.2.2.2

 area 0.0.0.0

  network 192.168.10.0 0.0.0.255

  network 192.168.20.0 0.0.0.255

 area 0.0.0.30

  network 192.168.100.0 0.0.0.255

 

R3

 interface gi  0/0/0 :ip addess 192.168.10.252 255.255.255.0

 vrrp vrid 10 virtual-ip 192.168.10.250

vrrp vrid 10 priority 80

   interface gi  0/0/1 :ip addess 192.168.20.252 255.255.255.0

 vrrp vrid 20 virtual-ip 192.168.20.250

 vrrp vrid 20 priority 150

 vrrp vrid 20 track interface GigabitEthernet0/0/2 reduced 100

  interface gi  0/0/2 :ip addess 192.168.100.1   255.255.255.0

ospf 1 router-id 3.3.3.3

 area 0.0.0.0

  network 192.168.10.0 0.0.0.255

  network 192.168.20.0 0.0.0.255

 area 0.0.0.30

  network 192.168.100.0 0.0.0.255

验证vlan与vlan之间

pc1 ping pc2、pc4

第三部分

sw1不用配置,端口默认开启

R4

interface gi0/0/0 :ip addess 192.168.100.2 255.255.255.0

interface gi0/0/1 :ip addess 192.168.30.254 255.255.255.0

ospf 1 router-id 4.4.4.4

 area 0.0.0.30

  network 192.168.30.0 0.0.0.255

  network 192.168.100.0 0.0.0.255

验证全网通

pc1 ping 服务器


华为设备stp 、vrrp的实力应用

标签:proc   ospf   环路   family   技术   华为   red   默认   备份   

原文地址:http://blog.51cto.com/13555885/2064698

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!