双平面网络BGP路径优化综合实验

  • Post author:
  • Post category:其他




一、双平面网络结构及实验要求

在这里插入图片描述


中间正方体结构为某大型企业的骨干网络。

每个城市的路由器A/B分别在一个运营商里面。通过连成口字型结构,和A/B面两个运营商的连接,形成互备。

【中间的E口线为公司自己拉的用于连接A-B的(为了避免走运营商之间的线跨运营商)】

XA/DG公司的两根线分别连在不同运营商上,且在不同城市(避免一个城市的网络或两个运营商同时出现问题的情况)

###实验要求###:

XA/DG的A/B业务分别走A/B面。如果其中一方断开,则走另一面;且同时去往A面的路由,优先选择A面的路径,(B同理)。

A面、B面、XA、DG分别在在AS内;A、B面内用EIGRP协议



二、流量模型及拓扑图规划

在这里插入图片描述

奇数面为A面,偶数面为B面,R100/R200分别对应XA/DG(端口两图是相同的)

A面在AS111,B面在AS222,R100在AS100,R200在AS200



R100有A业务10.111.1.1;B业务10.222.1.1

R200有A业务10.111.2.1;B业务10.222.2.1



流量模型:


1、线路正常时


R100:10.111.1.1–>R200:10.111.2.1 走A面

R100:10.222.1.1–>R200:10.222.2.1 走B面

这里不需要干涉,天然选路即是这样【以R100:10.222.1.1–>R200:10.222.2.1为例:R6上收到的10.222.2.1的路由as-path,A面传给R6的有两个AS号(200 111),B面传给R6的有一个AS号(200);BGP选路规则第四条,优先选择as-path小的,所以只会走B面不会拐到另一面去。】


2、R100–R1的线路断开(或R1城市该运营商的网络出现问题):


R100:10.111.1.1–>R200:10.111.2.1(去的路)

网段:20–56–57–30

解决方案:

R6上收到的去10.111.2.1的路由的as-path,A面传给R6的有两个AS号(200 111),B面传给R6的有一个AS号(200)根据BGP选路规则第四条,这里不会走A面;所以这里选择抓取A面的路由,在到R6时,weight属性值改为100(in方向),邻居为EBGP(默认为空,大优;且weight选路只会影响本路由器,其他路由器不识别该属性,会丢弃;而其他属性干涉选路在这里都不及weight属性)

ps:实际情况肯定不会只有一个公司,所以上面的操作适用于A/B面所有路由器。


3R200:10.111.2.1–>R100:10.111.1.1(回来的路)

网段:30–57–56–20

解决方案:

R7上收到的去10.111.1.1的路由的as-path,都有两个AS号(200 111/200 222 ),根据BGP选路规则第七条,(EBGP>IBGP),因此R7会怪向R8;所以这里选择抓取A面的路由,在到R7时,weight属性值改为100(in方向),邻居为IBGP。

此操作适用于A/B面所有路由器



三、配置过程


以R7为例:

基础配置:
interface Loopback0
 ip address 10.7.7.7 255.255.255.255
interface Ethernet0/0
 ip address 10.1.78.1 255.255.255.0
interface Serial1/0
 ip address 10.1.57.2 255.255.255.0
interface Serial1/1
 ip address 10.1.37.2 255.255.255.0
interface Serial2/0
 ip address 10.1.30.2 255.255.255.0
 
EIGRP:
router eigrp 1
 network 10.7.7.7 0.0.0.0
 network 10.1.37.0 0.0.0.255
 network 10.1.57.0 0.0.0.255
 
AS内的IBGP:
neighbor ibgp peer-group
 neighbor ibgp remote-as 111
 neighbor ibgp update-source Loopback0
 neighbor ibgp next-hop-self
 neighbor 10.3.3.3 peer-group ibgp
 neighbor 10.5.5.5 peer-group ibgp
 neighbor 10.1.1.1 peer-group ibgp
 传递社团属性
 neighbor ibgp send-community
 
AS间的EBGP直连建邻、和社团属性的传递:
 neighbor 10.1.30.1 remote-as 200
 neighbor 10.1.30.1 send-community
 neighbor 10.1.78.2 remote-as 222
 neighbor 10.1.78.2 send-community
 
修改社团属性数值改为aa:nn形式
ip bgp-community new-format
解释:select aa:nn format for BGP community

在R7上抓B面的路由,在入时,修改weight:
ip community-list 222 permit ^222:*
route-map 222 permit 10
 match community 222
 set weight 100
route-map 222 permit 20
调用,邻居为EBGP
router bgp 111
neighbor 10.1.78.2 route-map 222 in

在R7上抓A面的路由,在入时,修改weight:
ip community-list 111 permit ^111:*
route-map 111 permit 10
 match community 111
 set weight 100
route-map 111 permit 20
调用,邻居为IBGP
router bgp 111
neighbor ibgp route-map 111 in


以R100为例:

基础配置:
interface Loopback0
 ip address 10.100.100.100 255.255.255.255
interface Loopback111
 ip address 10.111.1.1 255.255.255.255
interface Loopback222
 ip address 10.222.1.1 255.255.255.255
interface Serial2/0
 ip address 10.1.10.1 255.255.255.0
interface Serial2/1
 ip address 10.1.20.1 255.255.255.0
 
AS间的EBGP直连建邻、和社团属性的传递:
router bgp 100
 bgp log-neighbor-changes
 network 10.111.1.1 mask 255.255.255.255
 network 10.222.1.1 mask 255.255.255.255
 neighbor 10.1.10.2 remote-as 111
 neighbor 10.1.10.2 send-community
 neighbor 10.1.20.2 remote-as 222
 neighbor 10.1.20.2 send-community

修改社团属性数值改为aa:nn形式
ip bgp-community new-format
解释:select aa:nn format for BGP community

修改社团属性,并调用:
ip prefix-list 111 seq 5 permit 10.111.1.1/32
ip prefix-list 222 seq 5 permit 10.222.1.1/32
route-map a permit 10
 match ip address prefix-list 111
 set community 111:1     
route-map a permit 20
 match ip address prefix-list 222
 set community 222:1
  neighbor 10.1.10.2 route-map a out
 neighbor 10.1.20.2 route-map a out

在R100上抓A/B面的路由,在入时,修改weight,并调用,邻居为EBGP:
ip community-list 111 permit ^111:*
ip community-list 222 permit ^222:*
route-map 111 permit 10
 match community 111
 set weight 100
route-map 111 permit 20
neighbor 10.1.10.2 route-map 111 in

route-map 222 permit 10
 match community 222
 set weight 100
route-map 222 permit 20
 neighbor 10.1.20.2 route-map 222 in



四、测试:



线路正常时:

R100:10.111.1.1–>R200:10.111.2.1

R100:10.222.1.1–>R200:10.222.2.1

在这里插入图片描述
R200:10.111.2.1–>R100:10.111.1.1

R200:10.222.2.1–>R100:10.222.1.1

在这里插入图片描述



R100–R1的线路断开


R100–R1的线路断开时:


在这里插入图片描述

在这里插入图片描述


做完策略后:


在这里插入图片描述
在这里插入图片描述

在这里插入图片描述



五、知识点补充


BGP选路原则:


不优的路由不参加选路

在这里插入图片描述

一些知识点的思维导图:


在这里插入图片描述



版权声明:本文为qq_41218884原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。