BGP路由黑洞实验:
实验拓扑:
实验需求:
- R2,R3,R4属于AS 100,R1属于AS 200,R5属于AS 300,
- AS 100内需要通过loopback口建立邻居关系,AS间用物理接口建立邻居关系,
- R2直接与R4建立IBGP邻居,R3上面不任何BGP的配置。
实验步骤:
-
配置IP地址,ping直连检验连通性(略)
-
配置AS 100内的OSPF(取R3配置):
[R3]ospf 1 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]network 10.0.34.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
-
查看OSPF邻居表:
[R3]dis ospf peer brief OSPF Process 1 with Router ID 10.0.23.3 Peer Statistic Information ---------------------------------------------------------------------------- Area Id Interface Neighbor id State 0.0.0.0 GigabitEthernet0/0/0 10.0.23.2 Full 0.0.0.0 GigabitEthernet0/0/1 10.0.34.4 Full ---------------------------------------------------------------------------- [R3] #状态为full,表明邻接关系建立成功。
-
配置BGP:
[R1]bgp 200 [R1-bgp]peer 10.0.12.2 as-number 100 [R1-bgp]peer 10.0.12.2 ebgp-max-hop 2 [R2]bgp 100 [R2-bgp]peer 4.4.4.4 as-number 100 [R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0 [R2-bgp]peer 10.0.12.1 as-number 200 [R2-bgp]peer 4.4.4.4 next-hop-local [R4]bgp 100 [R4-bgp]peer 2.2.2.2 as-number 100 [R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0 [R4-bgp]peer 10.0.45