BGP基本配置与总结

2023-05-16

使用BGP路由协议的意义是将自治系统中的路由通告到外部,而自治系统内使用的是IGP路由,这就是为什么内部BGP管理距离这么高,而外部BGP管理距离这么低的原因了。


1、建立BGP邻居的前提:在BGP的neighbor中指定的IP必须是可达对方的,不是使用直连接口的,可以通过静态路由、动态路由来到达指定的IP。

2、通告BGP网络即network:邻居建立完成后,就可以使用bgp通告本地网络了。在ibgp中使用其他的动态路由协议(如eigrp、ospf等),是为了第1步中做neighbor的IP可达而已。

3、必须修改BGP下一跳。

4、BGP同步规则,当启动同步情况下BGP路由器不应使用通过IBGP获悉的路由或将其通告给外部邻居,除非该路由是本地的或通过IBGP获悉的(注意“通过IBGP获悉”指的是当BGP与IGP同步情况下,即在该自治系统中BGP与IGP同时都通告了该路由,那么BGP路由器就可以将该路由通告到外部邻居。)。当禁用同步的情况下全互联IBGP拓扑就可以将从IBGP路由器获悉的路由通告给外部BGP。


实验:


实验拓扑:



1)验证neighbor中对方的IP不可达时,无法建立邻居关系(R2与R3)。

R2(config-router)#do sh run

router bgp 65001
 no synchronization
 bgp log-neighbor-changes
 network 2.2.2.2 mask 255.255.255.255
 network 10.1.1.0 mask 255.255.255.0
 neighbor 3.3.3.3 remote-as 65001
 neighbor 3.3.3.3 update-source Loopback0  //指本身的源地址接口
 no auto-summary


R3(config-router)#do sh run

router bgp 65001
 no synchronization
 bgp log-neighbor-changes
 network 3.3.3.3 mask 255.255.255.255
 network 10.1.1.0 mask 255.255.255.0
 neighbor 2.2.2.2 remote-as 65001
 neighbor 2.2.2.2 update-source Loopback0
 no auto-summary


在检查建立邻居结果(R2):

R2(config-router)#do sh ip bgp nei
BGP neighbor is 3.3.3.3,  remote AS 65001, internal link
  BGP version 4, remote router ID 0.0.0.0
  BGP state = Active
  Last read 00:02:37, last write 00:02:37, hold time is 180, keepalive interval is 60 seconds
  Message statistics:
    InQ depth is 0
    OutQ depth is 0
                         Sent       Rcvd
    Opens:                  0          0
    Notifications:          0          0
    Updates:                0          0
    Keepalives:             0          0
    Route Refresh:          0          0
    Total:                  0          0
  Default minimum time between advertisement runs is 0 seconds


 For address family: IPv4 Unicast
  BGP table version 1, neighbor version 0/0
 Output queue size : 0
  Index 1, Offset 0, Mask 0x2
  1 update-group member
                                 Sent       Rcvd
  Prefix activity:               ----       ----
    Prefixes Current:               0          0
    Prefixes Total:                 0          0
    Implicit Withdraw:              0          0
    Explicit Withdraw:              0          0
    Used as bestpath:             n/a          0
    Used as multipath:            n/a          0


                                   Outbound    Inbound
  Local Policy Denied Prefixes:    --------    -------
    Total:                                0          0
  Number of NLRIs in the update sent: max 0, min 0


  Connections established 0; dropped 0   \\established为0表明没有建立邻居关系。
  Last reset never
  No active TCP connection
R2(config-router)#do sh ip bgp    \\同时没有显示邻居拓扑表
BGP table version is 3, local router ID is 22.22.22.22
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete


   Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.2/32       0.0.0.0                  0         32768 i
*> 10.1.1.0/24      0.0.0.0                  0         32768 i

R2(config-router)#

建立邻居失败是由于R2与R3的环回接口IP相对是未知(不可达的)。

如果使用的是10.1.1.0/24作为建立邻居的网段,则R2 与R3邻居建立成功。

R2(config-router)#do sh  run

router bgp 65001
 no synchronization
 bgp log-neighbor-changes
 network 2.2.2.2 mask 255.255.255.255
 network 10.1.1.0 mask 255.255.255.0
 neighbor 10.1.1.2 remote-as 65001

R3(config-router)# do sh run

router bgp 65001
 no synchronization
 bgp log-neighbor-changes
 network 3.3.3.3 mask 255.255.255.255
 network 10.1.1.0 mask 255.255.255.0
 neighbor 10.1.1.1 remote-as 65001
 no auto-summary


R2(config-router)#do sh 
*Mar  1 00:29:20.323: %BGP-5-ADJCHANGE: neighbor 10.1.1.2 Up 
R2(config-router)#do sh bgp nei
BGP neighbor is 10.1.1.2,  remote AS 65001, internal link
  BGP version 4, remote router ID 33.33.33.33
  BGP state = Established, up for 00:00:04
  Last read 00:00:04, last write 00:00:04, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received
  Message statistics:
    InQ depth is 0
    OutQ depth is 0
                         Sent       Rcvd
    Opens:                  1          1
    Notifications:          0          0
    Updates:                1          1
    Keepalives:             3          3
    Route Refresh:          0          0
    Total:                  5          5
  Default minimum time between advertisement runs is 0 seconds


 For address family: IPv4 Unicast
  BGP table version 6, neighbor version 6/0
 Output queue size : 0
  Index 1, Offset 0, Mask 0x2
  1 update-group member
                                 Sent       Rcvd
  Prefix activity:               ----       ----
    Prefixes Current:               2          2 (Consumes 104 bytes)
    Prefixes Total:                 2          2
    Implicit Withdraw:              0          0
    Explicit Withdraw:              0          0
    Used as bestpath:             n/a          1
    Used as multipath:            n/a          0


                                   Outbound    Inbound
  Local Policy Denied Prefixes:    --------    -------
    Bestpath from this peer:              1        n/a
    Total:                                1          0
  Number of NLRIs in the update sent: max 2, min 2


  Connections established 1; dropped 0  \\表明邻居关系建立成功。
  Last reset never
Connection state is ESTAB, I/O status: 1, unread input bytes: 0            
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 255
Local host: 10.1.1.1, Local port: 14656
Foreign host: 10.1.1.2, Foreign port: 179


Enqueued packets for retransmit: 0, input: 0  mis-ordered: 0 (0 bytes)


Event Timers (current time is 0x1AF6DC):
Timer          Starts    Wakeups            Next
Retrans             5          0             0x0
TimeWait            0          0             0x0
AckHold             3          1             0x0
SendWnd             0          0             0x0
KeepAlive           0          0             0x0
GiveUp              0          0             0x0
PmtuAger            0          0             0x0
DeadWait            0          0             0x0


iss: 1178971408  snduna: 1178971571  sndnxt: 1178971571     sndwnd:  16222
irs: 3142416282  rcvnxt: 3142416445  rcvwnd:      16222  delrcvwnd:    162


SRTT: 148 ms, RTTO: 1301 ms, RTV: 1153 ms, KRTT: 0 ms
minRTT: 60 ms, maxRTT: 316 ms, ACK hold: 200 ms
Flags: active open, nagle
IP Precedence value : 6


Datagrams (max data segment is 1460 bytes):
Rcvd: 5 (out of order: 0), with data: 3, total data bytes: 162
Sent: 7 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 4, total data bytes: 162
R2(config-router)# do sh ip bgp
BGP table version is 6, local router ID is 22.22.22.22
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete


   Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.2/32       0.0.0.0                  0         32768 i
*>i3.3.3.3/32       10.1.1.2                 0    100      0 i
* i10.1.1.0/24      10.1.1.2                 0    100      0 i
*>                  0.0.0.0                  0         32768 i
R2(config-router)#do sh ip rou

Gateway of last resort is not set


     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.1.0 is directly connected, Serial0/0
     3.0.0.0/32 is subnetted, 1 subnets
B       3.3.3.3 [200/0] via 10.1.1.2, 00:00:55
     22.0.0.0/32 is subnetted, 1 subnets
C       22.22.22.22 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/1
R2(config-router)#


在实际操作中经常使用环回接口作为建立邻居的源地址,所以IBGP中通常使用静态路由或动态路由协议将环回接口及不直连的路由器网段先配置可达,之后再建立IBGP邻居关系。以IBGP与OSPF为例:

R2(config-router)#do sh run

!
router ospf 1
 log-adjacency-changes
 network 2.2.2.2 0.0.0.0 area 0
 network 10.1.1.0 0.0.0.255 area 0
 network 22.22.22.22 0.0.0.0 area 0
!
router bgp 65001
 no synchronization
 bgp log-neighbor-changes
 network 2.2.2.2 mask 255.255.255.255
 network 10.1.1.0 mask 255.255.255.0
 neighbor 3.3.3.3 remote-as 65001
 neighbor 3.3.3.3 update-source Loopback0
 no auto-summary

R3(config-router)#do sh run

!
router ospf 1
 log-adjacency-changes
 network 3.3.3.3 0.0.0.0 area 0
 network 10.1.1.0 0.0.0.255 area 0
 network 33.33.33.33 0.0.0.0 area 0
!
router bgp 65001
 no synchronization
 bgp log-neighbor-changes
 network 3.3.3.3 mask 255.255.255.255
 network 10.1.1.0 mask 255.255.255.0
 neighbor 2.2.2.2 remote-as 65001
 neighbor 2.2.2.2 update-source Loopback0
 no auto-summary


IBGP邻居成功建立后结果:

R2(config-router)#do sh ip bgp

Connections established 1; dropped 0   \\建立邻居成功。
  Last reset never



R2(config-router)#do sh ip rou
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.1.0 is directly connected, Serial0/0
     33.0.0.0/32 is subnetted, 1 subnets
O       33.33.33.33 [110/65] via 10.1.1.2, 00:00:44, Serial0/1
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 10.1.1.2, 00:00:44, Serial0/1
     22.0.0.0/32 is subnetted, 1 subnets
C       22.22.22.22 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/1
R2(config-router)#    

在IBGP中使用OSPF后,路由表中没有显示相关BGP路由,由于IBGP管理距离200,而OSPF管理距离为110,所以同一路由下使用OSPF。那为什么在router bgp 65001协议中还要通告本地路由器的网段呢?这主要为了通告给外部EBGP自治系统而用,如果只在OSPF协议中通告,外部EBGP是无法可达65001这个自治系统的。


与外部EBGP建立关系:

R1(config-router)#do sh run

router bgp 65002
 no synchronization
 bgp log-neighbor-changes
 network 1.1.1.1 mask 255.255.255.255
 network 11.11.11.11 mask 255.255.255.255
 network 100.1.1.0 mask 255.255.255.0
 neighbor 100.1.1.2 remote-as 65001
 no auto-summary

R2(config-router)#do sh run

router ospf 1

 log-adjacency-changes
 network 2.2.2.2 0.0.0.0 area 0
 network 10.1.1.0 0.0.0.255 area 0
 network 22.22.22.22 0.0.0.0 area 0
!
router bgp 65001
 no synchronization
 bgp log-neighbor-changes
 network 2.2.2.2 mask 255.255.255.255
 network 10.1.1.0 mask 255.255.255.0
 neighbor 3.3.3.3 remote-as 65001
 neighbor 3.3.3.3 update-source Loopback0
 neighbor 100.1.1.1 remote-as 65002
 no auto-summary
!

检查结果:

R1(config-router)#do sh ip rou

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
B       2.2.2.2 [20/0] via 100.1.1.2, 00:01:08
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.1.0 is directly connected, Serial0/0
     3.0.0.0/32 is subnetted, 1 subnets
B       3.3.3.3 [20/0] via 100.1.1.2, 00:01:08
     10.0.0.0/24 is subnetted, 1 subnets
B       10.1.1.0 [20/0] via 100.1.1.2, 00:01:08
     11.0.0.0/32 is subnetted, 1 subnets
C       11.11.11.11 is directly connected, Loopback1

\\外部自治系统R1中没有看到R2中22.22.22.22及R3的33.33.33.33路由
R1(config-router)#      do sh ip bgp

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                  0         32768 i
*> 2.2.2.2/32       100.1.1.2                0             0 65001 i
*> 3.3.3.3/32       100.1.1.2                              0 65001 i
*> 10.1.1.0/24      100.1.1.2                0             0 65001 i
*> 11.11.11.11/32   0.0.0.0                  0         32768 i
*> 100.1.1.0/24     0.0.0.0                  0         32768 i
R1(config-router)#


可以看出因没有在IBGP协议中通告22.22.22.22及33.33.33.33,从而外部EBGP路由表中没有相关路由。将这两条路由在各自本地路由器上的IBGP协议通告后,外部EBGP路由表显示。

R1(config)#do sh ip rou

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
B       2.2.2.2 [20/0] via 100.1.1.2, 00:11:46
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.1.0 is directly connected, Serial0/0
     33.0.0.0/32 is subnetted, 1 subnets
B       33.33.33.33 [20/0] via 100.1.1.2, 00:02:36
     3.0.0.0/32 is subnetted, 1 subnets
B       3.3.3.3 [20/0] via 100.1.1.2, 00:11:46
     22.0.0.0/32 is subnetted, 1 subnets
B       22.22.22.22 [20/0] via 100.1.1.2, 00:03:11
     10.0.0.0/24 is subnetted, 1 subnets
B       10.1.1.0 [20/0] via 100.1.1.2, 00:11:47
     11.0.0.0/32 is subnetted, 1 subnets
C       11.11.11.11 is directly connected, Loopback1

R1(config)#  


3)BGP下一跳属性

就EBGP而言,下一跳地址就是发送更新的邻居路由器的IP地址。

然而,IBGP规定,应在IBGP中通告EBGP通告的下一跳。从拓扑图中我们 知道R3要到达R1网络,必须经过R2,但我们查看R3的BGP表发现

R3(config-router)#do sh ip bgp
BGP table version is 29, local router ID is 33.33.33.33
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete


   Network          Next Hop            Metric LocPrf Weight Path
* i1.1.1.1/32       100.1.1.1                0    100      0 65002 i    \\显然R3下一跳直接是R1的接口,说明下一跳错误的。
r>i2.2.2.2/32       2.2.2.2                  0    100      0 i
*> 3.3.3.3/32       0.0.0.0                  0         32768 i
* i10.1.1.0/24      2.2.2.2                  0    100      0 i
*>                  0.0.0.0                  0         32768 i
* i11.11.11.11/32   100.1.1.1                0    100      0 65002 i
r>i22.22.22.22/32   2.2.2.2                  0    100      0 i
*> 33.33.33.33/32   0.0.0.0                  0         32768 i
* i100.1.1.0/24     100.1.1.1                0    100      0 65002 i

所以要修改这下一跳,由于此路由是在R2上通告的,所以在R2上BGP协议上添加如下命令neighbor 3.3.3.3 next-hop-self,结果R3通往R1的下一跳正常

R3(config-router)#do sh ip bgp
BGP table version is 32, local router ID is 33.33.33.33
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete


   Network          Next Hop            Metric LocPrf Weight Path
* i1.1.1.1/32       2.2.2.2                  0    100      0 65002 i   \\表明正常。
r>i2.2.2.2/32       2.2.2.2                  0    100      0 i
*> 3.3.3.3/32       0.0.0.0                  0         32768 i
* i10.1.1.0/24      2.2.2.2                  0    100      0 i
*>                  0.0.0.0                  0         32768 i
* i11.11.11.11/32   2.2.2.2                  0    100      0 65002 i
r>i22.22.22.22/32   2.2.2.2                  0    100      0 i
*> 33.33.33.33/32   0.0.0.0                  0         32768 i
* i100.1.1.0/24     2.2.2.2                  0    100      0 65002 i
R3(config-router)#



4)BGP同步实验

从R1的路由表可以看到到达R3的所有路由3.3.3.3等,但从R1却ping不能3.3.3.3,为什么呢?

R1#tracerou 3.3.3.3 


Type escape sequence to abort.
Tracing the route to 3.3.3.3


  1 100.1.1.2 24 msec 48 msec 16 msec
  2  *  *  * 
  3  *  *  * 
  4  *  *  * 
  5  *  * 

再看R3上路由表及BGP表

R3#sh ip rou

     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/65] via 10.1.1.1, 00:55:57, Serial0/1
     33.0.0.0/32 is subnetted, 1 subnets
C       33.33.33.33 is directly connected, Loopback1
     3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
     22.0.0.0/32 is subnetted, 1 subnets
O       22.22.22.22 [110/65] via 10.1.1.1, 00:55:57, Serial0/1
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/1
R3#       
R3#sh ip bgp
BGP table version is 8, local router ID is 33.33.33.33
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete


   Network          Next Hop            Metric LocPrf Weight Path
* i1.1.1.1/32       2.2.2.2                  0    100      0 65002 i
r>i2.2.2.2/32       2.2.2.2                  0    100      0 i
*> 3.3.3.3/32       0.0.0.0                  0         32768 i
* i10.1.1.0/24      2.2.2.2                  0    100      0 i
*>                  0.0.0.0                  0         32768 i
* i11.11.11.11/32   2.2.2.2                  0    100      0 65002 i
r>i22.22.22.22/32   2.2.2.2                  0    100      0 i
*> 33.33.33.33/32   0.0.0.0                  0         32768 i
* i100.1.1.0/24     2.2.2.2                  0    100      0 65002 i

从R3的BGP表可以看出它已经获悉到达R1的路由了,但却没有将路由加入到路由表中,原因是R3是通过R2即IBGP获悉的路由,按BGP规则R3不能使用通过IBGP路由器获悉的路由(不管是启动或禁用同步,自治系统中只要运行BGP协议的路由器的BGP表都是一样的。所以当BGP路由器ASBR从外部获悉的路由后都会在自治系统中通告,而自治系统内的IBGP路由器都会收到BGP路由器ASBR通告的外部路由,但只保存在BGP表中,而不会将其加入到路由表中,即无效路由,因此哪个路由器把同步关闭,那么那个IBGP路由器就可以将外部路由加入到路由表中)。

3.1、启动同步(不推荐)后,只有当BGP与IGP同步了路由(这里的同步是指将BGP重分发必到IGP中,比如在中转路径自治系统中BGP表获悉了多个自治系统的外来路由,然而这些外来路由没有同步到IGP中即没有重分发到IGP中,那么这些外来路由不会被中转路径自治系统中的IBGP路由器所通告,就像来例中ospf没有通告33.33.33.33时一样。这种方法如果有大量外来路由情况下,就不好操作,汇聚慢等,不推荐使用)),其他IBGP路由器才会将从IBGP获悉的路由通告到外部邻居。

从ospf中删除33.33.33.33的通告后,R1的BGP表及路由表如下

R1#sh ip bgp

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                  0         32768 i
*> 2.2.2.2/32       100.1.1.2                0             0 65001 i
*> 3.3.3.3/32       100.1.1.2                              0 65001 i
*> 10.1.1.0/24      100.1.1.2                0             0 65001 i
*> 11.11.11.11/32   0.0.0.0                  0         32768 i
*> 22.22.22.22/32   100.1.1.2                0             0 65001 i
*> 100.1.1.0/24     0.0.0.0                  0         32768 i
R1#sh ip rou

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
B       2.2.2.2 [20/0] via 100.1.1.2, 01:35:26
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.1.0 is directly connected, Serial0/0
     3.0.0.0/32 is subnetted, 1 subnets
B       3.3.3.3 [20/0] via 100.1.1.2, 01:35:26
     22.0.0.0/32 is subnetted, 1 subnets
B       22.22.22.22 [20/0] via 100.1.1.2, 01:35:26
     10.0.0.0/24 is subnetted, 1 subnets
B       10.1.1.0 [20/0] via 100.1.1.2, 01:35:27
     11.0.0.0/32 is subnetted, 1 subnets
C       11.11.11.11 is directly connected, Loopback1


R2的BGP表

R2#sh ip bgp

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       100.1.1.1                0             0 65002 i
*> 2.2.2.2/32       0.0.0.0                  0         32768 i
r>i3.3.3.3/32       3.3.3.3                  0    100      0 i
* i10.1.1.0/24      3.3.3.3                  0    100      0 i
*>                  0.0.0.0                  0         32768 i
*> 11.11.11.11/32   100.1.1.1                0             0 65002 i
*> 22.22.22.22/32   0.0.0.0                  0         32768 i
* i33.33.33.33/32   3.3.3.3                  0    100      0 i
r> 100.1.1.0/24     100.1.1.1                0             0 65002 i
R2#

可以看到由于bgp与ospf中33.33.33.33这条路由没有同步,所以R2即便BGP表中有33.33.33.33也不会通告到外部邻居,而其他同步的路由则通告。

3.2、禁用同步(推荐)后,BGP路由器可使用从IBGP获悉的路由或将其通告给外部邻居,即便BGP与IGP没有同步的情况下。在R2上的BGP中关闭同步no synchronization,则R1可收到33.33.33.33的通告。

R1#sh ip bgp
BGP table version is 35, local router ID is 11.11.11.11
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete


   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                  0         32768 i
*> 2.2.2.2/32       100.1.1.2                0             0 65001 i
*> 3.3.3.3/32       100.1.1.2                              0 65001 i
*> 10.1.1.0/24      100.1.1.2                0             0 65001 i
*> 11.11.11.11/32   0.0.0.0                  0         32768 i
*> 22.22.22.22/32   100.1.1.2                0             0 65001 i
*> 33.33.33.33/32   100.1.1.2                              0 65001 i     \\在R3的BGP通告而OSPF上没有通告。
*> 100.1.1.0/24     0.0.0.0                  0         32768 i


这样之后我们在R3上关闭BGP同步no synchronization,使R3能够将R2通告的路由加入到路由表中。


R3(config-router)#do sh ip bgp

   Network          Next Hop            Metric LocPrf Weight Path
*>i1.1.1.1/32       2.2.2.2                  0    100      0 65002 i \\表明已成功加入路由表中
r>i2.2.2.2/32       2.2.2.2                  0    100      0 i
*> 3.3.3.3/32       0.0.0.0                  0         32768 i
* i10.1.1.0/24      2.2.2.2                  0    100      0 i
*>                  0.0.0.0                  0         32768 i
*>i11.11.11.11/32   2.2.2.2                  0    100      0 65002 i
r>i22.22.22.22/32   2.2.2.2                  0    100      0 i
*> 33.33.33.33/32   0.0.0.0                  0         32768 i
*>i100.1.1.0/24     2.2.2.2                  0    100      0 65002 i
R3(config-router)#

R3(config-router)#do sh ip rou
     1.0.0.0/32 is subnetted, 1 subnets
B       1.1.1.1 [200/0] via 2.2.2.2, 00:01:37
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/65] via 10.1.1.1, 00:31:24, Serial0/1
     100.0.0.0/24 is subnetted, 1 subnets
B       100.1.1.0 [200/0] via 2.2.2.2, 00:01:37
     33.0.0.0/32 is subnetted, 1 subnets
C       33.33.33.33 is directly connected, Loopback1
     3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
     22.0.0.0/32 is subnetted, 1 subnets
O       22.22.22.22 [110/65] via 10.1.1.1, 00:31:25, Serial0/1
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/1
     11.0.0.0/32 is subnetted, 1 subnets
B       11.11.11.11 [200/0] via 2.2.2.2, 00:01:40
R3(config-router)# 

验证在R1上ping 3.3.3.3结果

R1#ping 3.3.3.3


Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/44/60 ms
R1#

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

BGP基本配置与总结 的相关文章

  • 如何将Java程序打成可执行jar包

    前几天 xff0c 公司运维找我让我帮他写个Java小程序 xff0c 读取磁盘指定目录的文件 xff0c 然后根据读取的内容查询第三方接口 xff0c 再将第三方接口响应的数据写入磁盘文件 然后我花了半天给他写了这个小程序 xff0c 但
  • javafx_scenebuilder-2_0-windows.msi 百度云盘下载

    javafx scene builder 官网下载很慢 网上有很多人分享 xff0c 都要付积分下载 下面是从官网下载好的 xff0c 传我百度网盘了 xff0c 有需要的大家去下载吧 链接 xff1a https pan baidu co
  • 100+套Axure数据可视化大屏展示原型模板及通用主键库

    内置多种实用美观的可视化组件库及行业模板库 xff0c 行业模板涵盖 xff1a 金融 教育 医疗 政府 交通 制造等多个行业 xff0c 提供设计参考 随着大数据的发展 xff0c 可视化大屏在各行各业得到越来越广泛的应用 可视化大屏不再
  • 数据可视化大屏UI界面

    数据可视化大屏 科技大屏展示 智慧城市 智慧农业 领导页展示大屏 PSD文件 UI可视化大屏模板PSD文件 156套可视化大屏PSD设计文件 xff0c 送给有需要的人 格式格式 xff1a PSD jpg 适合人群 xff1a 可视化大屏
  • SpringBoot 自定义注解实现Redis缓存功能

    背景 最近小A的公司要做一个大屏可视化平台 xff0c 主要是给领导看的 xff0c 领导说这个项目要给领导演示 xff0c 效果好不好直接关系到能不能拿下这个项目 xff0c 领导还补了一句 这项目至少是百万级的 xff0c 大伙要全力以
  • Linux 下 chmod 777 修改权限

    一 rwxrwxrwx 777 Unix Linux 的操作系统 xff0c 每个文件 文件夹也被看作是文件 都按读 写 运行设定权限 例如用ls l命令列文件表时 xff0c 得到如下输出 xff1a rw r r 1 mchopin u
  • Spring创建对象初始化bean的时机分为两种形式:

    import org junit Test import org springframework context ApplicationContext import org springframework context support C
  • 页面动态数据的滚动效果——jquery滚动组件(vticker.js)

    lt script language 61 34 javascript 34 src 61 34 lirms Test jquery 1 4 2 js 34 gt lt script gt lt script language 61 34
  • MySQL 查询结果以百分比显示

    找了一些资料 xff0c 然后我是用到了MySQL字符串处理中的两个函数concat 和left 1 span style color ff0000 CONCAT span str1 str2 返回来自于参数连结的字符串 如果任何参数是 N
  • rpm包安装过程中依赖问题“libc.so.6 is needed by XXX”解决方法

    转自 xff1a http raksmart idcspy com 781 rpm包安装过程中依赖问题 libc so 6 is needed by XXX 解决方法 与本教程高度相关文章 xff08 读完应该可以解决你的问题 xff09
  • 艺博: linux命令大宝典系列之mkdir创建目录

    在成长的过程中 人总要经历一些痛苦和挫折才能更加成熟与坚强 目录 mkdir是什么mkdir的语法mkdir的选项含义mkdir的实例1 使用mkdir命令创建一个dir1目录 默认权限775 2 使用mkdir m命令新建一个dir2目录
  • linux命令xrandr修改桌面分辨率

    xrandr临时修改分辨率 方法一 打开终端xrandr Screen 0 minimum 8 x 8 current 1366 x 768 maximum 32767 x 32767 eDP1 connected primary 1366
  • Python 教你训练一个98%准确率的微博抑郁文本分类模型(含数据)

    Paddle是一个比较高级的深度学习开发框架 xff0c 其内置了许多方便的计算单元可供使用 xff0c 我们之前写过PaddleHub相关的文章 xff1a 1 Python 识别文本情感就这么简单 2 比PS还好用 xff01 Pyth
  • 记一次神奇的时间转换问题(SheetJS)

    最近在写一个功能 xff0c 使用SheetJS读取Excel表格 xff0c 在读取日期的时候发现了一个隐藏很深的坑 xff0c 特此记录一下 SheetJS读取Excel文件时 xff0c 可指定参数 cellDates true xf
  • 通信常识

    bsc指的是基站控制器 xff08 Base Station Controller xff09 由一下模块组成 xff1a AM CM模块 xff1a 话路交换和信息交换的中心 BM模块 xff1a 完成呼叫处理 信令处理 无线资源管理 无
  • python解析基于xml格式的日志文件

    大家中午好 xff0c 由于过年一直还没回到状态 xff0c 好久没分享一波小知识了 xff0c 今天 xff0c 继续给大家分享一波python解析日志的小脚本 首先 xff0c 同样的先看看日志是个啥样 都是xml格式的 xff0c 是
  • 如何在无显示屏的情况下调试树莓派

    一 准备 1 树莓派 xff1b 2 SD卡 读卡器 网线 xff1b 3 系统镜像下载链接 xff1b 4 软件 xff1a SD Card Formatter下载链接 xff1b balenaEtcher下载链接 xff1b VNC V
  • VNC怎么和宿主机共享粘贴板

    VNC怎么和宿主机共享粘贴板 假设目标主机是linux xff0c 终端主机是windows xff08 就是在windows上使用VNC登陆linux xff09 在linux中执行vncconfig nowin amp 在linux选中
  • 系统调用,进程切换

    模式切换 不等同于 进程上下文切换 当进程调用系统调用或者发生中断时 xff0c CPU从用户模式 xff08 用户态 xff09 切换成内核模式 xff08 内核态 xff09 xff0c 此时 xff0c 无论是系统调用程序还是中断服务
  • brew换源

    bin zsh c 34 curl fsSL https gitee com cunkai HomebrewCN raw master Homebrew sh 34 mac安装homebrew失败怎么办 xff1f 金牛肖马的回答 知乎 h

随机推荐

  • 2022年书单

    2022年书单 纸质书 类别序号书名进度社会科学0 从零开始的女性主义 x1f44c 社会科学1 如何抑制女性写作 x1f44c 社会科学2 父权制与资本主义 社会科学3 下流社会 x1f44c 社会科学4 低欲望社会 x1f44c 社会科
  • 书店漫游记录

    目录 北京 上海 杭州 天津 南京 青岛 深圳 香港 北京 万圣书园 豆瓣书店 野草书店 三联韬奋书店 xff08 三里屯 xff09 三联韬奋书店 xff08 美术馆 xff09 Pageone xff08 北京坊 xff09 Pageo
  • C++ std::string 不可初始化为NULL及基本用法

    偶然看到一个问题 xff0c 顺便总结一下std string C 43 43 basic string S construct null not valid stackoverflow例子 std string 字符串不可以初始化为NUL
  • 通过查看端口状态查看mongodb是否已经启动

    LINUX环境下 xff0c 可以通过查看端口27017的状态查看mongod是否已经启动 netstat lanp span class hljs string grep 34 span span class hljs number 27
  • linux & windows C++开发差异

    新手注意事项 1 文件与目录的大小写以及路径分隔符的差别 windows下不区分大小写 xff0c 路径分隔符一般使用 xff1b linux下区分大小写 xff0c 路径分隔符使用 2 itoa 函数在linux下并不存在 所以使用类似s
  • 深度学习结合SLAM的研究思路/成果整理之(一)使用深度学习方法替换SLAM中的模块

    整理了部分近两年深度学习结合SLAM的一些研究成果 xff08 参考知乎帖子https www zhihu com question 66006923 和泡泡机器人公众号 xff0c 附上论文链接和已找到的源代码 数据集链接 xff0c 大
  • 深度学习与自动驾驶领域的数据集(KITTI,Oxford,Cityscape,Comma.ai,BDDV,TORCS,Udacity,GTA,CARLA,Carcraft)

    http blog csdn net solomon1558 article details 70173223 Torontocity HCI middlebury caltech 行人检测数据集 ISPRS航拍数据集 mot challe
  • 又一遍……ORB_SLAM2+ZED相机(SDK2.2.1)+CUDA9.0+ROS Kinetic 安装测试 some tips

    很久没碰过ORB SLAM2了 xff0c 今天有需要 xff0c 再来试一遍 xff5e ORB SLAM2的github链接 1 安装ORB SLAM2的依赖库 按照链接一步一步来就可以 eigen直接用命令安装就可以 sudo apt
  • MacOS设置终端代理

    前言 国内的开发者或多或少都会因为网络而烦恼 xff0c 因为一些特殊原因有时候网络不好的时候需要使用代理才能完成对应的操作 原来我一直都是使用斐讯路由器然后刷了梅林的固件 xff0c 直接在路由器层面设置转发代理 xff0c 把一些国内网
  • Linux SIGPIPE信号产生原因与解决方法

    TCP 四次握手 产生SIGPIPE的原因 SIGPIPE信号产生的原因 xff1a 简单来说 xff0c 就是客户端程序向服务器端程序发送了消息 xff0c 然后关闭客户端 xff0c 服务器端返回消息的时候就会收到内核给的SIGPIPE
  • Homebrew最新安装--解决安装超时的问题

    更新 2021 1 20 可以直接用下边的脚本进行安装 bin zsh c span class token string 34 span class token variable span class token variable spa
  • TIDB使用时的注意点笔记

    场景 xff1a 虽然TiDB号称完全兼容MySQL 5 7 协议 MySQL 5 7 常用的功能及语法 xff0c 但是其与MySQL数据库仍然存在一些差异 xff0c 可能会导致下游TiDB环境故障 以下是我们使用TiDB时需要重点关注
  • SpringBoot结合MyBatis-Plus快速CRUD笔记

    提示 xff1a 文章写完后 xff0c 目录可以自动生成 xff0c 如何生成可参考右边的帮助文档 文章目录 前言一 DTO amp DO二 示例1 定义Controller2 定义Service和实现3 定义Mapper4 前端访问测试
  • Java最佳实践笔记

    一 常量定义最佳实践 span class token keyword public span span class token keyword final span span class token keyword class span
  • 聊聊JavaSPI

    文章目录 前言一 SPI 示例二 SPI原理与双亲委派机制1 MySQL Driver2 DataX 插件的热插拔也是破坏双亲委派的一种3 Tomcat类加载同样是破坏了双亲委托 总结参考文章 前言 SPI 全称为 Service Prov
  • 实时平台开发笔记

    文章目录 一 背景二 功能模块划分1 作业台主要功能任务生命周期 2 任务列表主要功能 3 项目管理4 模板管理5 UDF管理 三 问题解决1 kerberos认证问题2 分布式锁解决Job名称冲突问题3 自定义线程池用以监控线程运行情况4
  • 二叉树快速拾遗笔记

    文章目录 前言二叉树前中后序遍历反转二叉树二叉树最大最小深度对称二叉树判断是否是平衡二叉树构造最大二叉树前序遍历打印二叉树二叉树层次遍历二叉树中和为某一值的路径总结 前言 二叉树基础内容拾遗 xff0c 使用递归解题三部曲 xff1a 找整
  • 链表拾遗笔记

    文章目录 1 反转单链表2 打印单链表3 O 1 删除指定节点4 双指针法求求链表倒数第k个节点5 判断链表是不是有环6 合并两个单链表7 删除链表中的重复节点7 实现一个单链表总结 提示 xff1a 以下是本篇文章正文内容 xff0c 下
  • 经典的排序算法拾遗笔记

    文章目录 选择排序插入排序冒泡排序快速排序二分查找交换两个位置的元素 总结 各种排序算法复杂度总结如下 xff1a 选择排序 分析 xff1a span class token comment 选择排序 4 3 5 1 4 3 5 1 le
  • BGP基本配置与总结

    使用BGP路由协议的意义是将自治系统中的路由通告到外部 xff0c 而自治系统内使用的是IGP路由 xff0c 这就是为什么内部BGP管理距离这么高 xff0c 而外部BGP管理距离这么低的原因了 1 建立BGP邻居的前提 xff1a 在B