通信网络
【实验题目】
通过配置BGP环境实现1.1.1.1/24环回与5.5.5.5/24环回的连通(AS 2 内部使用OSPF协议)
【实验思路】
配置BGP的前提是要保证各个自治区域的路由均可达,所以要首先在AS 2 配置OSPF使AS 2 通畅,然后再配置BGP。由于BGP的路由黑洞问题,需要在BGP路由经过的所有路由器上配置BGP。又由于IBGP的水平分割机制,R2、R4之间需要建立对等体关系。习惯上,在IBGP中最好使用环回接口来建立对等体关系。
【实验记录】
一、为各个路由器创建环回接口,配置IP地址
sys [Huawei]sys r1 [r1]interface LoopBack 0 [r1-LoopBack0]ip address 1.1.1.1 24 [r1-LoopBack0]q [r1]int GigabitEthernet 0/0/0 [r1-GigabitEthernet0/0/0]ip address 12.0.0.1 24
sys [Huawei]sys r2 [r2]int GigabitEthernet 0/0/1 [r2-GigabitEthernet0/0/1]ip address 12.0.0.2 24 [r2-GigabitEthernet0/0/1]int g0/0/0 [r2-GigabitEthernet0/0/0]ip address 23.0.0.1 24 [r2-GigabitEthernet0/0/0]q [r2]int LoopBack 0 [r2-LoopBack0]ip address 2.2.2.2 24
sys [Huawei]sys r3 [r3]int g0/0/1 [r3-GigabitEthernet0/0/1]ip address 23.0.0.2 24 [r3-GigabitEthernet0/0/1]int g0/0/0 [r3-GigabitEthernet0/0/0]ip address 34.0.0.1 24 [r3-GigabitEthernet0/0/0]q [r3]int LoopBack 0 [r3-LoopBack0]ip address 3.3.3.3 24
sys [Huawei]sys r4 [r4]int g0/0/1 [r4-GigabitEthernet0/0/1]ip address 34.0.0.2 24 [r4-GigabitEthernet0/0/1]int g0/0/0 [r4-GigabitEthernet0/0/0]ip address 45.0.0.1 24 [r4-GigabitEthernet0/0/0]q [r4]int LoopBack 0 [r4-LoopBack0]ip address 4.4.4.4 24
sys [Huawei]sys r5 [r5]int g0/0/1 [r5-GigabitEthernet0/0/1]ip address 45.0.0.2 24 [r5-GigabitEthernet0/0/1]q [r5]int LoopBack 0 [r5-LoopBack0]ip address 5.5.5.5 24
二、在AS2内配置OSPF
[r2]ospf 1 router-id 2.2.2.2 [r2-ospf-1]a 0 [r2-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255 [r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r3]ospf 1 router-id 3.3.3.3 [r3-ospf-1]a 0 [r3-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255 [r3-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255 [r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r4]ospf 1 router-id 4.4.4.4 [r4-ospf-1]a 0 [r4-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255 [r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
检查路由表,并ping通测试,确保无误
三、建立BGP对等体关系
[r1]bgp 1 [r1-bgp]router-id 1.1.1.1 [r1-bgp]peer 12.0.0.2 as-number 2
[r2]bgp 2 [r2-bgp]router-id 2.2.2.2 [r2-bgp]peer 12.0.0.1 as-number 1 [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 [r4-bgp]peer 45.0.0.2 as-number 3
[r5]bgp 3 [r5-bgp]router-id 5.5.5.5 [r5-bgp]peer 45.0.0.1 as-number 2
查看对等体关系建立情况:
四、发布路由
发布1.1.1.1/24
[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
发布5.5.5.5/24
[r5-bgp]network 5.5.5.0 24
[r4-bgp]network 5.5.5.0 24 [r4-bgp]peer 2.2.2.2 next-hop-local [r4-bgp]peer 3.3.3.3 next-hop-local
五、ping通测试
试验成功
审核编辑:黄飞
全部0条评论
快来发表一下你的评论吧 !