一、实验内容
二、拓扑设计
环回为1.1.1.0/24、2.2.2.0/24、3.3.3.0/24、4.4.4.0/24、5.5.5.0/24
三、实施
1、底层,所有节点拥有合法的IP地址
R1:
R2:
R3:
R4:
R5:
PC端手工配置IP地址(PC1为例)
2、路由(AS2运行OSPF协议)
R2:
R3:
R4:
测试:
3、策略
(1)手写静态,使AS间环回之间能够ping通
[r1]ip route-static 2.2.2.2 24 12.1.1.2
[r2]ip route-static 1.1.1.1 24 12.1.1.1
[r4]ip route-static 5.5.5.5 24 45.1.1.2
[r4]ip route-static 5.5.5.5 24 54.1.1.1
[r5]ip route-static 4.4.4.4 24 45.1.1.1
[r5]ip route-static 4.4.4.4 24 54.1.1.2
测试:
(2)建立EBGP邻居(建议使用环回接口建立)
单线建邻
[r1]bgp 1
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 2.2.2.2 as-number 2
[r1-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r1-bgp]peer 2.2.2.2 ebgp-max-hop 2
[r2]bgp 2
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 1.1.1.1 as-number 1
[r2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[r2-bgp]peer 1.1.1.1 ebgp-max-hop 2
多物理链路建邻
[r4]bgp 2
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 5.5.5.5 as-number 3
[r4-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[r4-bgp]peer 5.5.5.5 ebgp-max-hop 2
[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
[r5-bgp]peer 4.4.4.4 ebgp-max-hop 2
测试:
AS1与AS2成功建邻
AS4与AS5成功建邻
(2)建立IBGP邻居
[r2]bgp 2
[r2-bgp]peer 3.3.3.3 as-number 2
[r2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r2-bgp]peer 4.4.4.4 as-number 2
[r2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r3]bgp 2
[r3-bgp]router-id 3.3.3.3
[r3-bgp]peer 2.2.2.2 as-number 2
[r3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r3-bgp]peer 4.4.4.4 as-number 2
[r3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r4]bgp 2
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 2.2.2.2 as-number 2
[r4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r4-bgp]peer 3.3.3.3 as-number 2
[r4-bgp]peer 3.3.3.3 connect-interface LoopBack 0
测试:
(4)AS之间传递路由
宣告
[r1]bgp 1
[r1-bgp]network 192.168.1.0 24
[r2]bgp 2
[r2-bgp]network 192.168.2.0 24
[r2-bgp]network 192.168.3.0 24
[r2-bgp]network 192.168.4.0 24
[r5]bgp 3
[r5-bgp]network 192.168.5.0 24
AS内部修改IBGP邻居之间下一跳属性
[r2-bgp]peer 3.3.3.3 next-hop-local
[r2-bgp]peer 4.4.4.4 next-hop-local
[r3-bgp]peer 2.2.2.2 next-hop-local
[r3-bgp]peer 4.4.4.4 next-hop-local
[r4-bgp]peer 3.3.3.3 next-hop-local
[r4-bgp]peer 2.2.2.2 next-hop-local
测试:
R1:
R5:
(5)测试:用PC1访问所有客户端
所有要求完成