对于邻居关系,来自路由器 R1 的更新源 IP 必须与路由器 R2 上的邻居命令匹配,反之亦然
为了测试上面的内容,我用 R1 和 R2 设置了我的实验室来测试上面的内容。(参考下图)
R1#sho ip int bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 1.1.1.1 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down down
Loopback0 11.11.11.11 YES manual up up
R1#
R1#
R1#sho run | sec router bgp
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 22.22.22.22 remote-as 2
neighbor 22.22.22.22 ebgp-multihop 2
no auto-summary
R1#
R1#sho ip route 22.22.22.22
Routing entry for 22.0.0.0/8
Known via "static", distance 1, metric 0
Routing Descriptor Blocks:
* 1.1.1.2
Route metric is 0, traffic share count is 1
R1#sho ip bgp summary | b Neighbor
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
22.22.22.22 4 2 13 12 0 0 0 00:26:10 Active
对于 R2,我有
R2#sho ip int bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet0/1 1.1.1.2 YES manual up up
Loopback0 22.22.22.22 YES manual up up
R2#sho run | sec router bgp
router bgp 2
no synchronization
bgp log-neighbor-changes
neighbor 11.11.11.11 remote-as 1
neighbor 11.11.11.11 ebgp-multihop 2
no auto-summary
R2#
R2#sho ip route 11.11.11.11
Routing entry for 11.0.0.0/8
Known via "static", distance 1, metric 0
Routing Descriptor Blocks:
* 1.1.1.1
Route metric is 0, traffic share count is 1
R2#sho ip bgp summary | b Neighbor
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
11.11.11.11 4 1 6 7 0 0 0 00:17:27 Active
R2#
Q1:正如你看到的,我的BGP邻居关系是停留在活跃state.From我了解,R1预计从R2的邻居关系报文的源IP22.22.22.22
如果你这样做sho ip route了11.11.11.11在R2上,你看到它是通过教训1.1.1.1作为static route。因此,来自 R2 的 bgp 邻居数据包将使用此出口源 ip( 1.1.1.2) 请确认我的理解是否正确
Q2:我在 R2 上添加了以下内容。
R2(config)#router bgp 2
R2(config-router)#ne
R2(config-router)#nei
R2(config-router)#neighbor 11.11.11.11 up
R2(config-router)#neighbor 11.11.11.11 update-source lo
R2(config-router)#neighbor 11.11.11.11 update-source loopback 0
R2(config-router)#end
R2#
*Mar 1 00:56:26.211: %SYS-5-CONFIG_I: Configured from console by console
R2#sho ip bgp summary | b Neighbor
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
11.11.11.11 4 1 6 7 0 0 0 00:35:17 Active
R2#
*Mar 1 00:56:37.107: %BGP-5-ADJCHANGE: neighbor 11.11.11.11 Up
R2#
bgp 邻居现在出现了。我的问题是 - 为什么在第一种情况下没有出现邻居?

Q3:现在我公布了一个从 R2 到 R1 的不同环回,如下所示
R2(config-router)#do sho run int lo2
Building configuration...
Current configuration : 61 bytes
!
interface Loopback2
ip address 222.222.222.222 255.255.0.0
end
R2(config)#router bgp 2
R2(config-router)#network 222.222.0.0 mask 255.255.0.0
然后在 R1 上,我看到收到的前缀
R1#sho ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 1.0.0.0/8 is directly connected, FastEthernet0/0
S 22.0.0.0/8 [1/0] via 1.1.1.2
C 11.0.0.0/8 is directly connected, Loopback0
B 222.222.0.0/16 [20/0] via 22.22.22.22, 00:04:53
R1#
问:R1 正在学习222.222.0.0,下一跳为22.22.22.22。为什么是22.22.22.22下一跳?