BGP双平面实验-实配

广域骨干网BGP双平面架构

实验拓扑

在这里插入图片描述

设计思路

骨干网设计为双平面,电信一个平面,联通一个平面,在全国主要铺设网络的地方架两台机器,一台连电信,一台连联通,两设备之间用万兆线连接,将全国的电信划一个AS,全国的联通划一个AS,各地的电信联通正常建EBGP邻,这样一来流量的来往可以基于‘面’进行分流,如果全国的一个运营商挂了,或者一个城市的某台设备挂了,都不能影响网络的正常通信,具有极强的可靠性;
接入骨干网的各个站点,可用一个设备接入两个运营商(穷),在其上策略使其业务分流互备;可用两个设备达到用于冗余备份(小资),一个挂了,另一个承载所有流量;如果站点所流通的流量较多(数据中心-壕),可以让两个设备分别接入两个运营商,达到更稳定的冗余程度;

实验配置

IP地址规划

业务流量:10.1.0.0/16
办公流量:10.2.0.0/16
联通面:100.1.0.0/16
联通面连接电信面链路使用此网段;

电信面:100.2.0.0/16
骨干网路由器的环回使用其自身路由编号,如R2的环回ip为10.1.2.2;
r2的各端口IP如下:

Interface                         IP Address/Mask      Physical   Protocol  
Ethernet0/0/0                     100.1.24.1/24        up         up        
Ethernet0/0/1                     100.1.26.1/24        up         up        
GigabitEthernet0/0/0              100.1.23.1/24        up         up        
GigabitEthernet0/0/1              100.1.12.2/24        up         up        
GigabitEthernet0/0/2              unassigned           down       down      
GigabitEthernet0/0/3              unassigned           down       down      
LoopBack0                         100.1.2.2/24         up         up(s)     
NULL0                             unassigned           up         up(s) 
动态路由铺设

所有自治系统内起动态路由ospf,注:联通面与电信面的直连链路不可宣告在ospf内。
r2上OSPF配置如下:

[r2]ospf 1
[r2-ospf-1]dis th
#
ospf 1 router-id 100.1.2.2
 area 0.0.0.0
  network 100.1.24.0 0.0.0.255
  network 100.1.26.0 0.0.0.255
  network 100.1.2.0 0.0.0.255
#
划分AS,起BGP建邻

如上图所示,各站点各划为一个AS,电信和联通各划为一个AS,运营商AS内,使用环回建邻,在4.5.6.7号路由器上做反射器,电信与联通,AS之间建EBGP邻;
注:使用环回建邻时,必须peer 环回IP地址,设置更新源为loopback0口
r2的BGP配置如下:

[r2]bgp 1
[r2-bgp]dis th
#
bgp 1
 router-id 100.1.2.2
 peer 100.1.4.4 as-number 1
 peer 100.1.4.4 connect-interface LoopBack0
 peer 100.1.6.6 as-number 1
 peer 100.1.6.6 connect-interface LoopBack0
 peer 100.1.12.1 as-number 3
 peer 100.1.23.2 as-number 2
 #
 ipv4-family unicast
  undo synchronization
  peer 100.1.4.4 enable
  peer 100.1.4.4 next-hop-local
  peer 100.1.6.6 enable
  peer 100.1.6.6 next-hop-local
  peer 100.1.12.1 enable
  peer 100.1.23.2 enable
#
路由策略,分流互备

BGP选路规则
1、 下一跳不可达,忽略此路由
2、 PrefVal最高
3、 Local-Pref最高
4、 本地生成的路由,手动聚合>自动聚合>Network引入>import-route引入>对等体学习
5、 AS-path最短
6、 Origin: i > e > ?
7、 MED最低
8、 从EBGP邻居学来的路由优于从IBGP邻居学来的
9、 下一跳IGPmetric最小,即IGP最近的下一跳 若设置BGP负载均衡数不为1,未选出最佳则负载,若BGP负载数为1则继续
10、 优选Clustr_List最短的路由 11、 优选router-id最小的路由器发布的路由
12、 比较邻居的IP address,优选从具有较小IP address的对等体学来的路由

分析:
左侧站点宣告需要传递的路由,右侧站点使用重发布局域网路由,左侧业务流量走联通面,办公流量走电信面,使用AS-path属性加大本侧路由的AS-path长度,使用PrefVal属性干涉本地对对端路由的选路(抓团体值);右侧两台路由器干涉对左侧路由的选路使用Local-Pref属性,可在ibgp邻居间传递,使用团体属性标记不同感兴趣流,业务流量标记为100:1,办公流量标记为100:2;
注:传递团体值必须在每个路由器上开启: peer 100.2.15.2 advertise-community
r1策略使用如下:

抓感兴趣流
#
ip ip-prefix 1 index 10 permit 10.1.1.0 24 greater-equal 24 less-equal 32
ip ip-prefix 2 index 10 permit 10.2.2.0 24 greater-equal 24 less-equal 32
ip ip-prefix 35 index 10 permit 10.1.3.0 24 greater-equal 24 less-equal 32
ip ip-prefix 35 index 20 permit 10.1.5.0 24 greater-equal 24 less-equal 32
ip ip-prefix 46 index 10 permit 10.2.4.0 24 greater-equal 24 less-equal 32
ip ip-prefix 46 index 20 permit 10.2.6.0 24 greater-equal 24 less-equal 32
#
ip community-filter 35 permit 100:1
ip community-filter 46 permit 100:2
定制策略
route-policy com permit node 10
 if-match community-filter 35
 apply preferred-value 150
#
route-policy com permit node 20
 if-match community-filter 46
#
route-policy com46 permit node 10
 if-match community-filter 46
 apply preferred-value 150
#
route-policy com46 permit node 20
#
邻居间调用
  peer 100.1.12.2 route-policy com import
  peer 100.2.15.2 route-policy com46 import


故障状态下:
站点与骨干网相连的链路发生故障,流量需切换到备份链路到达骨干网再回到主面,到达目标网段;
r2配置策略如下:

#策略加大AS-path
route-policy 246 permit node 10
 if-match ip-prefix 2
 apply as-path 1 1 additive
#
route-policy 246 permit node 20
#抓感兴趣流
ip ip-prefix 2 index 10 permit 10.2.0.0 16 greater-equal 16 less-equal 32
#调用
  peer 100.1.6.6 route-policy 246 import
  peer 100.1.4.4 route-policy 246 import

r3配置策略如下:

#策略加大AS-path
route-policy 135 permit node 10
 if-match ip-prefix 1
 apply as-path 2 2 additive
#
route-policy 135 permit node 20
#抓感兴趣流
ip ip-prefix 1 index 10 permit 10.1.0.0 16 greater-equal 16 less-equal 32
#调用
  peer 100.2.5.5 route-policy 135 import
  peer 100.2.7.7 route-policy 135 import

测试结果如下:
在这里插入图片描述在这里插入图片描述

关于选路:

正常情况下,在站点侧做好策略后,业务分流,来回一致,无需干涉;
站点侧去某个主线路的路挂掉后走备线路,然后走备平面到对面站点,导致所有流量都拥挤在一个运营商内,另一个运营商(主平面)过于清闲,所以需干涉选路使其到达备平面后跳转到主平面,走主平面到达对面站点,来回一致;干涉bgp不走ibgp邻而走ebgp邻,(正常下as-path制约肯定选IBGP),如果选择local-pref,as内具有传递性,导致正常链路(未断)下选路不符,可加长ibgp邻给路由的as-path,使其比ebgp邻的as-path长,回来时也因此一致;

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值