image

首先,R4和R2建立EBGP邻居,注意,EBGP邻居一般用物理接口,而不用环回接口。因为EBGP的TTL=1,如果用环回接口的话,要分别配置到对端环回接口的静态路由,并且必须配置命令ebgp-multihop,ebgp-multihop命令可以改变ebgp的TTL值,从而使R4和R2的环回接口可以互通。我们待会会在R3和R5之间采用此方法,到时再看详细配置。

R4的配置:
router bgp 4
bgp router-id 4.4.4.4
neighbor 24.1.1.2 remote-as 1

R2的配置:
router bgp 1
bgp router-id 2.2.2.2
neighbor 24.1.1.4 remote-as 4
这样配置完以后,R4和R2的EBGP邻居关系就建立了。
R4#sh ip bgp summary
BGP router identifier 4.4.4.4, local AS number 4
BGP table version is 5, main routing table version 5
4 network entries and 4 paths using 532 bytes of memory
2 BGP path attribute entries using 120 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP activity 4/20 prefixes, 4/0 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
24.1.1.2           4     1     169             169              5         0      0          02:43:13        0