实验使用软件:eNSP
拓扑图:
实验要求:
1.如图连接网络,合理规格IP地址,AS200内IGP协议为OSPF
2.R1属于AS 100:R2-R3-R4小AS 234 R5-R6-R7小AS567,同时声明大AS 200,R8属于AS300
3.R2-R5 R4-R7之间为联邦EBGP邻居关系
4.R1-R8之间通信
实验步骤:
1、按照拓扑图给网络中设备配置IP地址
2、在AS200中运行OSPF协议,首先实现R2到R7可通
3、进行各个设备的BGP配置
[r1]bgp 100
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.1.1.2 as-number 200
[r2]bgp 234
[r2-bgp]router-id 2.2.2.2
[r2-bgp]confederation id 200
[r2-bgp]confederation peer-as 567
[r2-bgp]peer 12.1.1.1 as-number 100
[r2-bgp]peer 3.3.3.3 as-number 234
[r2-bgp]peer 3.3.3.3 connect-interface l 0
[r2-bgp]peer 5.5.5.5 as-number 567
[r2-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[r2-bgp]peer 5.5.5.5 ebgp-max-hop
[r3]bgp 234
[r3-bgp]router-id 3.3.3.3
[r3-bgp]confederation id 200
[r3-bgp]peer 2.2.2.2 as
[r3-bgp]peer 2.2.2.2 as-number 234
[r3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r3-bgp]peer 4.4.4.4 as-number 234
[r3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r4]bgp 234
[r4-bgp]router-id 4.4.4.4
[r4-bgp]confederation id 200
[r4-bgp]confederation peer-as 567
[r4-bgp]peer 3.3.3.3 as-number 234
[r4-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r4-bgp]peer 7.7.7.7 as-number 567
[r4-bgp]peer 7.7.7.7 connect-interface LoopBack 0
[r4-bgp]peer 7.7.7.7 ebgp-max-hop
[r5]bgp 567
[r5-bgp]router-id 5.5.5.5
[r5-bgp]confederation id 200
[r5-bgp]confederation peer-as 234
[r5-bgp]peer 2.2.2.2 as-number 234
[r5-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r5-bgp]peer 2.2.2.2 ebgp-max-hop
[r5-bgp]peer 6.6.6.6 as-number 567
[r5-bgp]peer 6.6.6.6 connect-interface LoopBack 0
[r6]bgp 567
[r6-bgp]router-id 6.6.6.6
[r6-bgp]confederation id 200
[r6-bgp]peer 5.5.5.5 as-number 567
[r6-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[r6-bgp]peer 7.7.7.7 as-number 567
[r6-bgp]peer 7.7.7.7 connect-interface LoopBack 0
[r7]bgp 567
[r7-bgp]confederation id 200
[r7-bgp]router-id 7.7.7.7
[r7-bgp]confederation peer-as 234
[r7-bgp]peer 6.6.6.6 as-number 567
[r7-bgp]peer 6.6.6.6 connect-interface LoopBack 0
[r7-bgp]peer 4.4.4.4 as-number 234
[r7-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r7-bgp]peer 4.4.4.4 ebgp-max-hop
[r7-bgp]peer 78.1.1.2 as-number 300
[r8]bgp 300
[r8-bgp]router-id 8.8.8.8
[r8-bgp]peer 78.1.1.1 as-number 200
4、进行宣告
[r1-bgp]import-route direct
[r2-bgp]import-route ospf 1
[r2-bgp]import-route direct
[r7-bgp]import-route ospf 1
[r7-bgp]import-route direct
[r8-bgp]import-route direct
5、此时宣告的路由不优,(比如在R3路由器上面查看路由表,发现无法到达R1,所以在R2上面将下一跳改为local)
[r2-bgp]peer 3.3.3.3 next-hop-local
[r4-bgp]peer 3.3.3.3 next-hop-local
[r5-bgp]peer 6.6.6.6 next-hop-local
[r7-bgp]peer 6.6.6.6 next-hop-local
6、由于存在水平分割问题,所以还需要添加反射器
[r3-bgp]peer 2.2.2.2 reflect-client
[r3-bgp]peer 4.4.4.4 reflect-client
[r6-bgp]peer 5.5.5.5 reflect-client
[r6-bgp]peer 7.7.7.7 reflect-client
7、此时才完成全网可达,进行ping测试验证