详细解析配置BGP负载共享

出处:Examlink 作者:刀断水 日期:2007年09月20日 15时25分

 3.      多台边界路由器多宿主末端网络连接到单一ISP环境中的负载共享

  这个场景展示了当通过多个本地路由器到达同一ISP具有多条连接时如何完成负载共享。两个eBGP对等体分别建立在两个独立的本地路由器上。在两条链路上负载均衡是不可能发生的因为BGP会在从eBGP和iBGP学来的路由中挑选出一条最佳的路由。在去往AS10的多条路径上进行负载共享是很好的选择,这种负载共享可以基于预先制定的路由策略让去往某一特定网络的流量在两条链路上通过。此外,当其中一条链路失效后另外一条链路能充当其备分链路。

  现在假定AS11的BGP路由策略如下:

  ●       AS11接收来自AS10的本地路由,连同其余一些默认的Inetnet路由。

  ●       外出流量策略是:

  ①从R101去往Internet的所有流量走R101-R103这条链路。

  ②若R101-R103链路失效则R101去往Internet的所有流量从R102到达AS10.

  ③从R102去往Internet的所有流量走R102-R104这条链路。

  ④若R102-R104链路失效则R102去往Internet的所有流量从R101到达AS10.

  ●进入流量的策略是:

  ①从Inetnet到网络192.168.11.0/24的流量走R103-R101这条链路。

  ②从Inetnet到网络192.168.12.0/24的流量走R104-R102这条链路。

  ③如果到AS10的其中一条链路失效,那么另一条链路必须路由所有从Intnet返回到AS11的流量。

  要达成以上策略,就要使得经R101到R103所通告192.168.11.0的As-Path比经R102到R104的As-Path短,则AS10就会选择R103-R101链路为最佳路径。同样的,经R102-R104链路所通告的192.168.12.0也要有较短的As-Path,那么AS10就会为去往AS11网络192.168.12.0的流量优选链路R104-R102.

  对于外出的流量,BGP会根据通过eBGP学得的路由来决定最佳路径,这些路由也可从iBGP学到。所以R101既可以通过eBGP从R103学到10.10.34.0又可以通过iBGP从R102学到。但是外部路径优先于内部路径。所以R101到10.10.34.0的路由会走R101-R103链路,下一跳为10.10.13.3.R102到10.10.34.0的路由会走R102-R104链路下一跳为10.10.24.4.这样便在去往10.10.34.0的流量上达到了负载共享的效果。

  配置如下:

R101

R101(config)#int s1/1
R101(config-if)#ip add 10.10.13.1 255.255.255.0
R101(config-if)#no sh
R101(config-if)#int fa0/0
R101(config-if)#ip add 192.168.12.1 255.255.255.0
R101(config-if)#ip add 192.168.11.1 255.255.255.0 sec
R101(config-if)#no sh
R101(config)#router bgp 11
R101(config-router)#no syn
R101(config-router)#net 192.168.11.0
R101(config-router)#net 192.168.12.0
R101(config-router)#nei 10.10.13.3 remote-as 10
R101(config-router)#nei 10.10.13.3 route-map R101-R103-MAP out
R101(config-router)#nei 192.168.12.2 remote-as 11
R101(config-router)#nei 192.168.12.2 next-hop-self
R101(config-router)#maximum-paths 2
R101(config-router)#no auto-summary
R101(config-router)#access-list 1 permit 192.168.12.0
R101(config)#access-list 2 per 192.168.11.0
R101(config)#route-map R101-R103-MAP per 10
R101(config-route-map)#match ip add 1
R101(config-route-map)#set as-path prepend 11 11 11
R101(config-route-map)#route-map R101-R103-MAP per 20
R101(config-route-map)#match ip add 2

R102

R102(config)#int s1/2
R102(config-if)#ip add 10.10.24.2 255.255.255.0
R102(config-if)#no sh
R102(config-if)#int fa0/0
R102(config-if)#ip add 192.168.12.2 255.255.255.0
R102(config-if)#ip add 192.168.11.2 255.255.255.0 sec
R102(config-if)#no sh
R102(config)#router bgp 11
R102(config-router)#no syn
R102(config-router)#net 192.168.11.0
R102(config-router)#net 192.168.12.0
R102(config-router)#nei 10.10.24.4 remote-as 10
R102(config-router)#nei 10.10.24.4 route-map R102-R104-MAP out
R102(config-router)#nei 192.168.12.1 remote-as 11
R102(config-router)#nei 192.168.12.1 next-hop-self
R102(config-router)#no auto-summary
R102(config-router)#access-list 1 permit 192.168.11.0
R102(config)#access-list 2 per 192.168.12.0
R102(config)#route-map R102-R104-MAP per 10
R102(config-route-map)#match ip add 1
R102(config-route-map)#set as-path prepend 11 11 11
R102(config-route-map)#route-map R102-R104-MAP per 20
R102(config-route-map)#match ip add 2

R103

R103(config)#int s1/0
R103(config-if)#ip add 10.10.13.3 255.255.255.0
R103(config-if)#no sh
R103(config-if)#int fa0/0
R103(config-if)#ip add 10.10.34.3 255.255.255.0
R103(config-if)#no sh
R103(config)#router bgp 10
R103(config-router)#no syn
R103(config-router)#net 10.10.34.0 mask 255.255.255.0
R103(config-router)#nei 10.10.13.1 remote-as 11
R103(config-router)#nei 10.10.13.1 default-originate
R103(config-router)#nei 10.10.34.4 remote-as 10
R103(config-router)#nei 10.10.34.4 next-hop-self
R103(config-router)#no auto-summary

R104

R104(config)#int s1/0
R104(config-if)#ip add 10.10.24.4 255.255.255.0
R104(config-if)#no sh
R104(config-if)#int fa0/0
R104(config-if)#ip add 10.10.34.4 255.255.255.0
R104(config-if)#no sh
R104(config)#router bgp 10
R104(config-router)#no syn
R104(config-router)#nei 10.10.24.2 remote-as 11
R104(config-router)#nei 10.10.24.2 default-originate
R104(config-router)#nei 10.10.34.3 remote-as 10
R104(config-router)#nei 10.10.34.3 next-hop-self
R104(config-router)#no auto-summary

最后更新时间:2008-03-28 13:32:30
文章评论
共有 0 位网友发表了评论
用户名: 新注册) 密码: 匿名评论 [查看所有评论]

评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
您可以用以下几种方式找到此文章