[r1]bgp 1
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.1.1.2 as-number 2
[r2]bgp 2
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 12.1.1.1 as-number 1
[r2]bgp 2
[r2-bgp]peer 3.3.3.3 as-number 2[r3]bgp 2
[r3-bgp]router-id 3.3.3.3
[r3-bgp]peer 2.2.2.2 as-number 2
[r2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r4]ip route-static 5.5.5.0 24 45.1.1.2
[r4]ip route-static 5.5.5.0 24 54.1.1.2[r5]ip route-static 4.4.4.0 24 45.1.1.1
[r5]ip route-static 4.4.4.0 24 54.1.1.1
[r4]bgp 2
[r4-bgp]peer 5.5.5.5 as-number 3
[r4-bgp]peer 5.5.5.5 connect-interface LoopBack 0[r5]bgp 3
[r5-bgp]router-id 5.5.5.5
[r5-bgp]peer 4.4.4.4 as-number 2
[r5-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r4-bgp]peer 5.5.5.5 ebgp-max-hop 2
[r5-bgp]peer 4.4.4.4 ebgp-max-hop 2
[r1-bgp]network 1.1.1.0 24
[r1-bgp]display bgp routing-table 查看BGP路由
[r2-bgp]peer 3.3.3.3 next-hop-local
[r2-bgp]peer 4.4.4.4 as-number 2
[r2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r2-bgp]peer 4.4.4.4 next-hop-local
[r4]bgp 2
[r4-bgp]peer 2.2.2.2 as-number 2
[r4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r4]undo ip route-static 5.5.5.0 24 45.1.1.2
[r4]ip route-static 5.5.5.5 32 45.1.1.2[r5]undo ip route-static 4.4.4.0 24 45.1.1.1
[r5]ip route-static 4.4.4.4 32 45.1.1.1