站点图标 Linux-技术共享

华为HCIP认证 – BGP协议原理与配置方法详解

本文实例讲述了华为HCIP认证BGP协议原理与配置方法。分享给大家供大家参考,具体如下:
 

BGP协议原理与配置



BGP基本概述


BGP邻居关系建立与配置

配置步骤:

配置解释:


BGP路由生成方式



BGP通告原则与路由处理



BGP常用属性介绍

以上两个问题的解决方案:


BGP选路原则


   bgp 200
       peer 10.1.24.2 as-number 100
       peer 10.1.34.3 as-number 100
       peer 10.1.45.5 as-number 300
       peer 10.1.46.6 as-number 300
       #
       ipv4-family unicast
         undo synchronization
         peer 10.1.24.2 enable
         peer 10.1.24.2 route-policy MED-20 export
         peer 10.1.24.2 advertise-community
         peer 10.1.34.3 enable
         peer 10.1.34.3 route-policy MED-10 export
         peer 10.1.34.3 advertise-community
         peer 10.1.45.5 enable
         peer 10.1.45.5 route-policy 10 import
         peer 10.1.46.6 enable
         peer 10.1.46.6 route-policy 10 import
       #
       route-policy 10 permit node 10
         if-match community-filter 10
         apply ip-address next-hop 10.1.45.5
       #
       route-policy 10 permit node 20
         if-match community-filter 20
         apply ip-address next-hop 10.1.46.6
       #
       route-policy MED-10 permit node 10
         if-match community-filter 300:100
         apply cost 100
       #
       route-policy MED-20 permit node 10
         if-match community-filter 20
         apply cost 100
       #
       ip community-filter 10 permit 300:100
       ip community-filter 20 permit 300:200

       验证:在RTA上执行如下命令:
       tracert 100.0.0.1,观察所经过的IP地址。
       tracert 200.0.0.1,观察所经过的IP地址。


BGP路由聚合


 < RTB > display bgp routing-table
 Network NextHop  PrefVal Path/Ogn
 > 10.0.0.0 10.1.12.1  0   100?

 < RTC > display bgp routing-table
 Network NextHop  PrefVal Path/Ogn
 *> 10.0.0.0 10.1.23.2  0  200 100?

 < RTB > display bgp routing-table
   Network  NextHop  PrefVal Path/Ogn
 *> 10.1.8.0/22  10.1.12.1   0   100?

 < RTC > display bgp routing-table
   Network  NextHop  PrefVal Path/Ogn
 *> 10.1.8.0/22  10.1.23.2   0   200 100?



退出移动版