作家
登录

策略路由之双出口配置实例(1)

作者: 来源: 2012-06-20 08:04:56 阅读 我要评论

策略路由是一种比基于目标网络进行路由更加灵活的数据包路由转发机制。应用了策略路由,路由器将通过路由图决定如何对需要路由的数据包进行处理,路由图决定了一个数据包的下一跳转发路由器。 下面让我们通过一个实验来看一下双出口配置是怎样的过程。

策略路由实验拓朴:

策略路由实验要求:

1、R1连接本地子网,R2为边缘策略路由器,R3模拟双ISP接入的Internet环境。

2、要求R1所连接的局域网部分流量走R2-R3间上条链路(ISP1链路),部分流量走R2-R3间下条链路(ISP2链路)从而实现基于源的供应商链路选择和网络负载均衡。

各路由器配置如下:

  1. R1#sh run            //路由器R1的配置  
  2.  
  3. interface Loopback0                                               //模拟子网一:192.168.1.0/24  
  4.  
  5. ip address 192.168.1.1 255.255.255.0                     //模拟子网中第一台主机  
  6.  
  7. ip address 192.168.1.2 255.255.255.0 secondary    //模拟子网中第二台主机  
  8.  
  9. !  
  10.  
  11. interface Loopback2                                              //模拟子网二:192.168.2.0/24  
  12.  
  13. ip address 192.168.2.1 255.255.255.0  
  14.  
  15. ip address 192.168.2.2 255.255.255.0 secondary  
  16.  
  17. !  
  18.  
  19. interface FastEthernet0/0  
  20.  
  21. ip address 12.0.0.1 255.255.255.0  
  22.  
  23. bitscn.com  
  24.  
  25. !  
  26.  
  27. !  
  28.  
  29. router rip                            //通过RIP协议配置网络的连通性  
  30.  
  31. version 2 bitscn.com  
  32.  
  33. network 192.168.1.0  
  34.  
  35. network 192.168.1.0  
  36.  
  37. network 12.0.0.0  
  38.  
  39. R3#sh run                           //路由器R3的配置  
  40.  
  41. Building configuration  
  42.  
  43. interface Loopback0                 //模拟一个连接目标  
  44.  
  45. description to internet  
  46.  
  47. ip address 100.100.100.100 255.255.255.0  
  48.  
  49. !  
  50.  
  51. interface Serial1/1                    //模拟ISP1的接入端口  
  52.  
  53. ip address 123.0.0.3 255.255.255.0  
  54.  
  55. serial restart-delay 0  
  56.  
  57. !  
  58.  
  59. interface Serial1/3                  //模拟ISP2的接入端口  
  60.  
  61. bitscn.com  
  62.  
  63. ip address 223.0.0.3 255.255.255.0  
  64.  
  65. serial restart-delay 0  
  66.  
  67. !  
  68.  
  69. router rip  
  70.  
  71. version 2  
  72.  
  73. network 100.0.0.0  
  74.  
  75. network 123.0.0.0  
  76.  
  77. network 223.0.0.0  
  78.  
  79. no auto-summary  
  80.  
  81. !  
  82.  
  83. end  
  84.  
  85. R2#sh run                      //策略路由器R2的配置  
  86.  
  87. Building configuration...  
  88.  
  89. interface FastEthernet0/0  
  90.  
  91. ip address 12.0.0.2 255.255.255.0  
  92.  
  93. ip policy route-map isp-test      //在接口上启用策略路由isp-test进行流量控制  
  94.  
  95. duplex half  
  96.  
  97. !  
  98.  
  99. interface Serial1/1  
  100.  
  101. ip address 123.0.0.1 255.255.255.0  
  102.  
  103. serial restart-delay 0  
  104.  
  105. ! bitscn_com  
  106.  
  107. interface Serial1/3  
  108.  
  109. ip address 223.0.0.1 255.255.255.0 bitscn.com  
  110.  
  111. serial restart-delay 0  
  112.  
  113. router rip  
  114.  
  115. version 2  
  116.  
  117. network 12.0.0.0  
  118.  
  119. network 123.0.0.0  
  120.  
  121. network 223.0.0.0  
  122.  
  123. no auto-summary  
  124.  
  125. logging alarm informational  
  126.  
  127. access-list 101 permit ip 192.168.1.0 0.0.0.255 host 100.100.100.100   //访问控制列表101,用于过滤原地址,允许子网192.168.1.0流量通过 */  
  128.  
  129. access-list 102 permit ip 192.168.2.0 0.0.0.255 host 100.100.100.100   //访问控制列表102,用于过滤原地址,允许子网192.168.2.0流量通过 */  
  130.  
  131. !  
  132.  
  133. route-map isp-test permit 10            //定义route-map,取名为isp-test,序列为10  
  134.  
  135. match ip address 101                        //检查源地址,匹配acl 101  
  136.  
  137. set ip default next-hop 123.0.0.3     //指定下一跳地址  
  138.  
  139. !  
  140.  
  141. feedom.net  
  142.  
  143. route-map isp-test permit 20            //定义isp-test的第二条语句,序列号为20  
  144.  
  145. match ip address 102                        //检查源地下,匹配acl102  
  146.  
  147. set ip default next-hop 223.0.0.3  
  148.  
  149. !  
  150.  
  151. route-map isp-test permit 30            //定义isp-test的第三条语句,序列号为30  
  152.  
  153. set default interface Null0                //丢弃不匹配规定标准的包  
  154.  
  155. end  
  156.  
  157. --------------------------------------------------------------------------------- 

策略路由的内容不仅仅局限于以上介绍的内容,我们还会在以后的文章中继续向大家介绍。下一篇我们介绍:策略路由之双出口配置实例(2)

【编辑推荐】

  1. Cisco路由器的基本配置
  2. WINDOWS实现路由之动态路由协议
  3. WINDOWS实现路由之路由的基本概念

  推荐阅读

  Cisco路由器的基本配置

IOS简介随网络技术的不断发展,可动态地升级以适应不断变化的技术(硬件和软件)。IOS可以被视作一个网际互连中枢;一个高度智能的管理员,具有负责管理控制复杂的分布式网络资源的功能。IOS是Cisco路由软件的初始品>>>详细阅读


本文标题:策略路由之双出口配置实例(1)

地址:http://www.17bianji.com/luyou/5770.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)