速码!!BGP最全学习笔记:路由反射器实验配置

实验:配置路由反射器

1. 实验目的

  1. 熟悉路由反射器的应用场景
  2. 掌握路由反射器的配置方法

2. 实验拓扑

实验拓扑如图所示:

速码!!BGP最全学习笔记:路由反射器实验配置_第1张图片

    想要华为数通配套实验拓扑和配置笔记的朋友们点赞+关注,评论区留下邮箱发给你!     

3. 实验步骤

(1) 配置IP地址

R1的配置

system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

[Huawei]sysname R1

[R1]interface g0/0/0

[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24

[R1-GigabitEthernet0/0/0]quit

[R1]interface LoopBack 0

[R1-LoopBack0]ip address 1.1.1.1 32

[R1-LoopBack0]quit

R2的配置

system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

[Huawei]sysname R2

[R2]interface g0/0/1

[R2-GigabitEthernet0/0/1]ip address 12.1.1.2 24

[R2-GigabitEthernet0/0/1]quit

[R2]interface g0/0/0

[R2-GigabitEthernet0/0/0]ip address 23.1.1.2 24

[R2-GigabitEthernet0/0/0]quit

[R2]interface LoopBack 0

[R2-LoopBack0]ip address 2.2.2.2 32

[R2-LoopBack0]quit

R3的配置

system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

Info: Information center is disabled.

[Huawei]sysname R3

[R3]interface g0/0/1

[R3-GigabitEthernet0/0/1]ip address 23.1.1.3 24

[R3-GigabitEthernet0/0/1]quit

[R3]interface g0/0/0

[R3-GigabitEthernet0/0/0]ip address 34.1.1.3 24

[R3-GigabitEthernet0/0/0]quit

[R3]interface LoopBack 0

[R3-LoopBack0]ip address 3.3.3.3 32

[R3-LoopBack0]quit

R4的配置

system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

Info: Information center is disabled.

[Huawei]sysname R4

[R4]interface g0/0/1

[R4-GigabitEthernet0/0/1]ip address 34.1.1.4 24

[R4-GigabitEthernet0/0/1]quit

[R4]interface LoopBack 0

[R4-LoopBack0]ip address 4.4.4.4 32

[R4-LoopBack0]quit

(2)配置IGP

R2的配置

[R2]ospf router-id 2.2.2.2

[R2-ospf-1]area 0

[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

[R2-ospf-1-area-0.0.0.0]network 23.1.1.10 0.0.0.255

[R2-ospf-1-area-0.0.0.0]quit

R3的配置

[R3]ospf router-id 3.3.3.3

[R3-ospf-1]area 0

[R3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255

[R3-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255

[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

[R3-ospf-1-area-0.0.0.0]quit

R4的配置

[R4]ospf router-id 4.4.4.4

[R4-ospf-1]area 0

[R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0

[R4-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255

[R4-ospf-1-area-0.0.0.0]quit

  1. 配置BGP   R1与R2建立EBGP的邻居关系,R2与R3、R3与R4为IBGP的邻居关系。

R1的配置

[R1]bgp 100      

[R1-bgp]router-id 1.1.1.1

[R1-bgp]peer 12.1.1.2 as-number 200

[R1-bgp]quit

R2的配置

[R2]bgp 200

[R2-bgp]router-id 2.2.2.2

[R2-bgp]peer 12.1.1.1 as-number 100

[R2-bgp]peer 3.3.3.3 as-number 200

[R2-bgp]peer 3.3.3.3 connect-interface LoopBack 0

[R2-bgp]peer 3.3.3.3 next-hop-local

[R2-bgp]quit

R3的配置

[R3]bgp 200

[R3-bgp]router-id 3.3.3.3

[R3-bgp]peer 2.2.2.2 as-number 200

[R3-bgp]peer 2.2.2.2 connect-interface LoopBack 0

[R3-bgp]peer 4.4.4.4 as-number 200

[R3-bgp]peer 4.4.4.4 connect-interface LoopBack 0

[R3-bgp]quit

R4的配置

[R4]bgp 200

[R4-bgp]router-id 4.4.4.4

[R4-bgp]peer 3.3.3.3 as-number 200

    1. 实验调试
  1. 在R1上宣告1.1.1.1/32的路由

[R1]bgp 100

[R1-bgp]network 1.1.1.1 32

[R1-bgp]quit

  1. 在R3上查看路由表

[R3]display bgp routing-table

 BGP Local router ID is 3.3.3.3

 Status codes: * - valid, > - best, d - damped,

               h - history,  i - internal, s - suppressed, S - Stale

               Origin : i - IGP, e - EGP, ? - incomplet

 Total Number of Routes: 1

      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>i  1.1.1.1/32         2.2.2.2         0          100        0      100i

通过以上输出,可以看到1.1.1.1是最优的,但是我们在R4上是看不到1.1.1.1这条路由

想要华为数通配套实验拓扑和配置笔记的朋友们点赞+关注,评论区留下邮箱发给你!

  1. 在R3上查看BGP详细路由表,看它是否传递给了R4

  [R3]display bgp peer 4.4.4.4 verbose   //显示BGP对等体的详细信息。

        BGP Peer is 4.4.4.4,  remote AS 200  

        Type: IBGP link

        BGP version 4, Remote router ID 4.4.4.4

        Update-group ID: 1  

        BGP current state: Established, Up for 00h41m07s

        BGP current event: RecvKeepalive

        BGP last state: OpenConfirm

        BGP Peer Up count: 1

        Received total routes: 0

        Received active routes total: 0

        Advertised total routes: 0

        Port:  Local - 65228    Remote - 179

        Configured: Connect-retry Time: 32 sec

        Configured: Active Hold Time: 180 sec   Keepalive Time:60 sec

        Received  : Active Hold Time: 180 sec

        Negotiated: Active Hold Time: 180 sec   Keepalive Time:60 sec

        Peer optional capabilities:

        Peer supports bgp multi-protocol extension

        Peer supports bgp route refresh capability

        Peer supports bgp 4-byte-as capability

        Address family IPv4 Unicast: advertised and received

 Received: Total 43 messages

                 Update messages                0

                 Open messages                  1

                 KeepAlive messages             42

                 Notification messages          0

                 Refresh messages               0

 Sent: Total 44 messages                  

                 Update messages                0

                 Open messages                  2

                 KeepAlive messages             42

                 Notification messages          0

                 Refresh messages               0

 Authentication type configured: None     

 Last keepalive received: 2022-05-31 13:04:21-08:00

 Minimum route advertisement interval is 15 seconds

 Optional capabilities:                   

 Route refresh capability has been enabled

 4-byte-as capability has been enabled    

 Connect-interface has been configured    

 Peer Preferred Value: 0                  

 Routing policy configured:               

 No routing policy is configured          

通过以上输出,可以看到R3没有把路由传给R4,这是由于BGP水平分割的问题

【技术要点】

   BGP水平分割:BGP路由器,从IBGP邻居收到一条路由,不会传给它的其它IBGP邻居

  1. 将R3配置为路由反射器,指定R4为它的客户端

[R3]bgp 200

[R3-bgp]peer 4.4.4.4 reflect-client

[R3-bgp]quit

  1. 在R3上查看RR

[R3]display bgp peer 4.4.4.4 verbose

        BGP Peer is 4.4.4.4,  remote AS 200  

        Type: IBGP link

        BGP version 4, Remote router ID 4.4.4.4

        Update-group ID: 0  

        BGP current state: Established, Up for 00h49m17s

        BGP current event: RecvKeepalive

        BGP last state: OpenConfirm

        BGP Peer Up count: 1

        Received total routes: 0

        Received active routes total: 0

        Advertised total routes: 1

        Port:  Local - 65228    Remote - 179

        Configured: Connect-retry Time: 32 sec

        Configured: Active Hold Time: 180 sec   Keepalive Time:60 sec

        Received  : Active Hold Time: 180 sec

        Negotiated: Active Hold Time: 180 sec   Keepalive Time:60 sec

        Peer optional capabilities:

        Peer supports bgp multi-protocol extension

        Peer supports bgp route refresh capability

        Peer supports bgp 4-byte-as capability

        Address family IPv4 Unicast: advertised and received

 Received: Total 51 messages

                 Update messages                0

                 Open messages                  1

                 KeepAlive messages             50

                 Notification messages          0

                 Refresh messages               0

 Sent: Total 53 messages

                 Update messages                1

                 Open messages                  2

                 KeepAlive messages             50

                 Notification messages          0

                 Refresh messages               0

 Authentication type configured: None

 Last keepalive received: 2022-05-31 13:12:21-08:00

 Minimum route advertisement interval is 15 seconds

 Optional capabilities:

 Route refresh capability has been enabled

 4-byte-as capability has been enabled

 It's route-reflector-client

 Connect-interface has been configured

 Peer Preferred Value: 0

 Routing policy configured:

 No routing policy is configured

通过以上输出可以看到R4为RR的客户端

  1. 在R4上查看路由表

display bgp routing-table

 BGP Local router ID is 4.4.4.4

 Status codes: * - valid, > - best, d - damped,

               h - history,  i - internal, s - suppressed, S - Stale

               Origin : i - IGP, e - EGP, ? - incomplete

 Total Number of Routes: 1

      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>i  1.1.1.1/32         2.2.2.2         0          100        0      100i

通过以上输出可以看到R4的BGP路由表里有1.1.1.1了

  1. 查看起源ID和cluster list

display bgp routing-table 1.1.1.1

 BGP local router ID : 4.4.4.4

 Local AS number : 200

 Paths:   1 available, 1 best, 1 select

 BGP routing table entry information of 1.1.1.1/32:

 From: 3.3.3.3 (3.3.3.3)

 Route Duration: 00h06m33s  

 Relay IP Nexthop: 34.1.1.3

 Relay IP Out-Interface: GigabitEthernet0/0/1

 Original nexthop: 2.2.2.2

 Qos information : 0x0

 AS-path 100, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, best, select, active, pre 255, IGP cost 2

 Originator:  2.2.2.2   //本地AS中通告该路由的BGP路由器Router ID,存在多个RR也不会改变,防环

 Cluster list: 3.3.3.3  //当RR收到一条携带Cluster_list属性的BGP路由,且该属性值中包含该簇的Cluster_ID时,RR认为该条路由存在环路,因此将忽略关于该条路由的更新。

【技术要点】Cluster_List属性

路由反射器和它的客户机组成一个集群(Cluster),使用AS内唯一的Cluster ID作为标识。为了防止集群间产生路由环路,路由反射器使用Cluster_List属性,记录路由经过的所有集群的Cluster ID。

  • 当一条路由第一次被RR反射的时候,RR会把本地Cluster ID添加到Cluster List的前面。如果没有Cluster_List属性,RR就创建一个。
  • 当RR接收到一条更新路由时,RR会检查Cluster List。如果Cluster List中已经有本地Cluster ID,丢弃该路由;如果没有本地Cluster ID,将其加入Cluster List,然后反射该更新路由。

想要华为数通配套实验拓扑和配置笔记的朋友们点赞+关注,评论区留下邮箱发给你!

你可能感兴趣的:(学习,笔记,网络)