JunOS 在使用多个路由实例时是否会破坏 iBGP 规则?

网络工程 BGP 杜松-朱诺斯
2022-02-17 10:22:28

我已经设置了几个路由器,其中 1 是带有 2 个 iBGP 路由器的外部 eBGP 路由器。 这里的拓扑

来自 eBGP 对等体的路由正在登陆到Routing-Instance Ext,然后它们被移动到 inet.0或主表。然后,您可以看到 iBGP 对等通过 inet.0 和从 eBGP 邻居接受的外部路由在 eBGP 最后一个邻居中接受,而没有下一跳自我策略。

这是一个简单的基于 GNS3 的测试实验室。第一个路由器是 ios vm,但对于这种情况,供应商并不重要:

ip route 5.0.0.0 255.255.255.0 Null0
router bgp 1
 bgp log-neighbor-changes
 network 5.0.0.0 mask 255.255.255.0
 neighbor 10.0.0.1 remote-as 2

具有多个 RI 的 vMX 看起来像这样,并且所有路由器上不存在特殊策略,因此不存在 next hop self 语句:

interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.0.0.1/31;
            }}}
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 10.0.100.0/31;
            }}}
}
routing-options {
    instance-import route_import_master;
}
protocols {
    bgp {
        group iBGP {
            local-as 2;
            neighbor 10.0.100.1 {
                peer-as 2;
            }}}
}
policy-options {
    policy-statement route_import_master {
        term From_Ext {
            from {
                instance Ext;
                protocol bgp;
            }
            then accept;
        }
        then reject;
    }
}                                       
routing-instances {
    Ext {
        instance-type virtual-router;
        interface ge-0/0/0.0;
        protocols {
            bgp {
                group eBGP {
                    local-as 2;
                    neighbor 10.0.0.0 {
                        peer-as 1;
                    }}}}}}

这里我们可以将路由 5.0.0.0/24 导出到主路由表的结果路由:

>show route 

inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

5.0.0.0/24         *[BGP/170] 00:02:13, MED 0, localpref 100
                      AS path: 1 I, validation-state: unverified
                    > to 10.0.0.0 via ge-0/0/0.0

Ext.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

5.0.0.0/24         *[BGP/170] 00:02:13, MED 0, localpref 100
                      AS path: 1 I, validation-state: unverified
                    > to 10.0.0.0 via ge-0/0/0.0

接下来我的 iBGP 唯一路由器:

interfaces {
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 10.0.100.1/31;
            }}}
}
protocols {
    bgp {
        group iBGP {
            local-as 2;
            neighbor 10.0.100.0 {
                peer-as 2;
            }}}}

接下来我们可以看到 5.0.0.0/24 被接受并安装到路由表


inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 5.0.0.0/24              10.0.100.0           0       100        1 I

root> show route 5.0.0.0/24                         

inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

5.0.0.0/24         *[BGP/170] 00:13:10, MED 0, localpref 100
                      AS path: 1 I, validation-state: unverified
                    > to 10.0.100.0 via ge-0/0/1.0

此外,当我向 IP 5.0.0.1 的最顶层 eBGP 邻居发出 ping 指令时,看起来精简数据包到达 eBGP 路由器。

BGP1#debug  ip icmp 
ICMP packet debugging is on
BGP1#
*Dec 26 18:22:06.191: ICMP: dst (5.0.0.1) host unreachable sent to 10.0.100.1
*Dec 26 18:22:07.179: ICMP: dst (5.0.0.1) host unreachable sent to 10.0.100.1

这是否违反了基本的 iBGP 规则?

1个回答

你认为它违反了什么规则?

Ext VRF请注意,当泄漏从您到您的 BGP 路由时,master.inet.0您需要注意也泄漏 BGP 用作下一跳的路由。如果忽略这一点,泄露的 BGP 路由可能对master.inet.0.