笔记
实验
实验要求:通过bgp实现全网可达
1.配置IP
2.在AS200配置OSPF
[r2]ospf 1
[r2]area 0.0.0.0
[r2]network 2.2.2.2 0.0.0.0
[r2]network 23.0.0.0 0.0.0.255
[r3]ospf 1
[r3]area 0.0.0.0
[r3]network 3.3.3.3 0.0.0.0
[r3]network 23.0.0.0 0.0.0.255
[r3]network 34.0.0.0 0.0.0.255
[r4]ospf 1
[r4]area 0.0.0.0
[r4]network 4.4.4.4 0.0.0.0
[r4]network 34.0.0.0 0.0.0.255
直连建立和环回建立BGP对等体关系
[r1]bgp 100
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.0.0.2 as-number 200
[r2]bgp 200
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 12.0.0.1 as-number 100
[r2-bgp]peer 3.3.3.3 as-number 200
[r2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r2-bgp]peer 4.4.4.4 as-number 200
[r2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r3]bgp 200
[r3-bgp]router-id 3.3.3.3
[r3-bgp]peer 2.2.2.2 as-number 200
[r3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r3-bgp]peer 4.4.4.4 as-number 200
[r3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r4]bgp 200
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 2.2.2.2 as-number 200
[r4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r4-bgp]peer 3.3.3.3 as-number 200
[r4-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r4-bgp]peer 45.0.0.2 as-number 300
[r5]bgp 300
[r5-bgp]router-id 5.5.5.5
[r5-bgp]peer 4.4.4.4 as-number 200
[r5-bgp] peer 4.4.4.4 ebgp-max-hop 255
[r5-bgp] peer 4.4.4.4 connect-interface LoopBack 0
BGP路由发表
发布1.1.1.1 5.5.5.5 100.0.0.1网段
[r1-bgp]network 1.1.1.0 24
[r2-bgp]network 1.1.1.0 24
[r2-bgp]peer 3.3.3.3 next-hop-local
[r2-bgp]peer 4.4.4.4 next-hop-local
[r5-bgp]network 5.5.5.0 24
[r5-bgp]network 100.0.0.0 24
[r4-bgp]network 5.5.5.0 24
[r4-bgp]network 100.0.0.0 24
[r4-bgp]peer 2.2.2.2 next-hop-local
[r4-bgp]peer 3.3.3.3 next-hop-local
发布静态路由,并汇总172.16.0.0网段
[r2-bgp]import-route ospf 1
[R1]ip ip-prefix aaa permit 172.16.0.0 16 greater-equal 24 less-equal 24
[R1]route-policy aaa permit node 10
[R1-route-policy]if-match ip-prefix aaa
[R1-bgp]import-route direct route-policy aaa