规划好ip地址然后使用ospf进行宣告
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 0.0.0.0 255.255.255.255
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 47.1.1.2 0.0.0.0
[r2]bgp 64512
[r2-bgp]confederation id 200 设置BGP联盟ID为200
[r2-bgp]confederation peer-as 64513设置BGP联盟对等AS号为64513
[r2-bgp]router-id 2.2.2.2 设置BGP路由器ID为2.2.2.2
[r2-bgp]peer 3.3.3.3 as-number 64512对等BGP邻居为R3,其AS号为64512
[r2-bgp]peer 3.3.3.3 connect-interface lo 0与R3的对等连接接口为本地环回接口
[r2-bgp]peer 5.5.5.5 ebgp-max-hop 对等BGP邻居为R5,设置EBGP最大跳数为默认值
[r2-bgp]peer 3.3.3.3 next-hop-local对于到R3的路由,下一跳设置为本地地址
[r2-bgp]import-route direct 导入直连路由到BGP