stp,vrrp的应用-创新互联

  1. 实验名称 :运用stp ,vrrp ospf ,使内网可以访问外网

    在藁城等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供成都做网站、成都网站设计 网站设计制作按需设计,公司网站建设,企业网站建设,品牌网站建设,网络营销推广,成都外贸网站制作,藁城网站建设费用合理。

 2.实验拓布图:

             stp ,vrrp 的应用

4. 实验目的 :

 1 .运用生成树协议确定根交换机,

2 .运用vrrp协议,实现网关备份,链路负载均衡

        3 .内网可以访问外网  //外网模拟的是三条线路,分别是移动,电信,联通

 5.涉及到的技术 :   stp , vrrp ,ospf

       #  配置思路:

                首先在sw1,sw3,sw4确定根交换机,确定自己流量的走向,其次再到交换机 sw5 ,sw6,sw2,确定根交换机,确定流量的走向,  然

后再配置交换机到路由器采用vrrp协议,实现网关的冗余备份,链路的负载均衡,最后实现内网可以访问外网,当链路出现故障时,流量是如何访问外网的

       #  配置步骤 :

#配置pc的ip地址,并且,在交换机 sw1,sw3,sw4 上分别创建vlan,并且将相应的端口加入vlan ,交换机与交换机之间采用trunk链路

                  # 配置pc1的ip地址

                   ip address 192.168.10.1 255.255.255.0

                   配置 pc2的ip 地址

                      ip address 192.168.20.1 255.255.255.0

                    配置 pc3的ip 地址

                       ip address 192.168.10.2 255.255.255.0

                     配置pc4的ip地址

                       ip address 192.168.20. 2 255.255.255.0

           # 在交换机上创建sw1 ,sw2 sw3 ,sw4,sw5,sw6 ,创建vlan10 ,vlan20,vlan 数据库保持一致 ,并将相应的端口加入vlan 10 ,vlan 20


                    # vlan 10 ,vlan 20 // 在sw1上 创建

                       port-group group-member g0/0/1 g0/0/2

                        port link-type access

                        port default vlan 10 //将多个端口同时加入vlan10

                         interface g0/0/13

                         port link-type trunk

                           port trunk allow-pass vlan all

                           interface g0/0/12

                             port link-type trunk

                                  port trunk allow-pass vlan all

                              interface g0/0/3

                                port link-type access

                                port default vlan 10

                              #vlan 10 ,vlan 20//在sw3上创建

                               itnerface ether 0/0/13

                                  port link-type trunk

                                    port trunk allow-pass vlan all

                                     inerface ether 0/0/11

                                      port link-type trunk

                                     port trunk allow-pass vlan all

                                  itnerface ether 0/0/1

                                     port link-type access

                                   port defautl vlan 10

                                #   创建vlan10 ,vlan 20//在sw4上创建

                                     inteface ethernet 0/0/1

                                      port link-type access

                                      port default vlan 20

                                  port-group group-memeber ethernet 0/0/4 ethernet 0/0/1

                                      port link-type trunk

                                      port trunk allow-pass vlan all

# 在交换机上确定根交换机,查阻塞端口,查看流量的走向  //用生成树修改sw1的优先级 为 0 ,让sw1成为根交换机

          # stp priority 0  //修改交换机的优先级 ,sw1成为了根交换机

           # display stp brief //查看stp详细信息  //如下图所示

                                     stp ,vrrp 的应用

    #从上图可以看出,e0/0/11是阻塞端口, 所以可以看出,流量的走向是 pc1 是从sw3 e0/0/13 到g0/0/13 ,pc2的流量走向是从 sw2 eth 0/0/14 到g0/0/14

       # 接下来配置交换机,sw2,sw5,sw6, 同理可得 //配置省略

                stp ,vrrp 的应用

            #sw2为根交换机 ,阻塞端口为 ethernet0/0/11

              # 流量的走向为:从交换机sw5的ethernet 0/0/13 端口 到g0/0/13 ,从交换机的ethernet0/0/14到g0/0/14

             #接下来在路由器AR1,AR2上分别虚拟出一个虚拟网关 :192.168.10.250 ,192.168.20.250

                      #给AR1,AR2配置IP地址

                         interface g0/0/0

                             ip address 192.168.10. 254 255.255.255.0 //AR1上的配置

                          interface g 0/0/1

                              ip address 192.168.20.254 255.255.255.0 //在AR1上的配置

                          interface g0/0/0

                               ip address 192.168.10.253 255.255.255.0 //在AR2上的配置

                           interface g0/0/1

                                 ip address 192.168.20.253 255.255.255.0 //在AR2上的配置

                        #接下来配置,vrrp 实现网关的冗余备份,链路的负载均衡

                              # itnerface g0/0/0 //AR1上

                             vrrp vrid 10 virtual-ip 192.168.10.250 //虚拟出一个网关

                               vrrp vrid 10 priority 101 //使它的优先级大1 ,默认是100,,使它成为主网关

                                 vrrp vrid 10 track interface ethernet 4/0/0 //配置链路追踪,默认优先级降低10 ,,

             # interface g0/0/0 //在AR2上

                vrrp  vrid  10   virtual-ip 192.168.10.250 //虚拟出一个网关//不用设置它的优先级,使它的优先级保持默认,100,使它成为副网关

             # interface g0/0/1 //在 AR1上

               vrrp vrid virtual-ip 192.168.20.250 //虚拟出一个网关//不用设置它的优先级,使它的优先级保持默认,100,使它成为副网关

                      # inteface g0/0/1 //在AR2上

                       vrrp vrid 20 virtual-ip 192.168.20.250

                       vrrp vrid 20 priority 101 //使它的优先级大1 ,默认是100,,使它成为主网关

                         vrrp vrid 20 track interface g0/0/2 //默认优先级降低10,等链路恢复,它会争取优先权,当链路断开,它默认会降级,成为备份

  # 总结以上,说明 vlan 10的主网关在AR1上,vlan20为副网关 , 在AR2 上,vlan20的主网关在AR2上,vlan10为副网关

            # 接下来配置外网,采用技术ospf,先配置ip地址,创建相应的vlan , 最后使内网可以访问外网 //电信,移动,联通

                          itnerface ethernet 4/0/0

                                ip address 192.168.13.1 255.255.255.0 //在AR1上配置

                            # 在lsw7 上创建vlan 30 ,vlan 40

                                   # vlan 30  ,vlan 40

                                          interface ethernet 0/0/5

                                            port link-type access

                                               port default vlan 30

                                            interface vlan 30

                                                 ip address 192.168.13.2 255.255.255.0

                                    # inteface ethernet 0/0/4

                                           port link-type access

                                               port default vlan 40

                                                interface vlan 40

                                                  ip address 192.168.14.1 255.255.255.0

                                       # 在路由器上配置g0/0/1和g0/0/0的ip 地址

                                               itnerface g 0/0/ 1

                                                     ip address 192.168.14.2 255.255.255.0

                                                  interface g0/0/0

                                                      ip address 192.168.15.254 255.255.255.0

                                    # 配置server1的ip地址

                                            ip address 192.168.15.1 255.255.255.0

                                                   gateway 192.168.15.254

                                   #接下来运用ospf,创建区域0使内网可以访问外网

                                        ospf 1

                                          area 0

                                             network 192.168.13.1 0.0.0.0

                                             network 192.168.10.0 0.0.0.255

                                             network 192.168.20.0 0.0.0.255  //AR1上配置ospf

                                              ospf 1

                                           area 0

                                              network 192.168.13.2 0.0.0.0

                                              network 192.168.14.1 0.0.0.0 //lsw7上的配置

                                          ospf1

                                            area 0

                                               network 192.168.14.2 0.0.0.0

                                               etwork 192.168.15.254 0.0.0.0 //AR4上的配置

                                           #验证与测试:

                                                   ping 192.168.15.1

                                             stp ,vrrp 的应用

                         # 以上测试说明内网已经可以访问外网了

                                # 验证链路追踪 :

        使外网端口e 4/0/0//AR1上 关闭 

       #shutdown e 4/0/0

                                            # display vrrp //在AR2上

stp ,vrrp 的应用

                    stp ,vrrp 的应用

# 以上图示说明 :在AR2上vlan 10的网关已经变成主网关了, 流量已经不从AR1上走了,现在从AR2上走,其他的设置同里可得 :

—————————————————————————————————————————————————————————————————————————————————————————————————————— end

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


当前题目:stp,vrrp的应用-创新互联
本文链接:http://scyanting.com/article/jcecj.html