0
点赞
收藏
分享

微信扫一扫

BGP小实验

沐之轻语 2022-01-22 阅读 122

实验拓扑

实验要求

要求:所有由器发布自己的环回网段
发布方法用到 network和重发布两种(重发布通过路由策略仪发布环回网段
在1上创建两条课汇总的网段进行手工合
所有发布的网段之间可以互相通讯

实验分析与配置

(1)路由器接口环回配置

网段划分如上图所示

<Huawei>sys
[Huawei]sys r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[r1-GigabitEthernet0/0/0]int l0
[r1-LoopBack0]ip add 1.1.1.1 24

[Huawei]sys r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 23.0.0.1 24
[r2-GigabitEthernet0/0/1]int l0
[r2-LoopBack0]ip add 2.2.2.2 24
[r2-LoopBack0]q

<Huawei>sys
[Huawei]sys r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 23.0.0.2 24
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 34.0.0.1 24
[r3-GigabitEthernet0/0/1]int l0
[r3-LoopBack0]ip add 3.3.3.3 24
[r3-LoopBack0]q

<Huawei>sys
[Huawei]sys r4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 34.0.0.2 24
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 45.0.0.1 24
[r4-LoopBack0]ip add 4.4.4.4 24


<r5>sys
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 45.0.0.2 24
[r5-GigabitEthernet0/0/0]int l0
[r5-LoopBack0]ip add 5.5.5.5 24
 

(2)启动OSPF协议

[r2]ospf 1 rou    
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]a 0
[r2-ospf-1-area-0.0.0.0]ne    
[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 rou    
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]a 0
[r3-ospf-1-area-0.0.0.0]ne    
[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

 

[r4]ospf 1 rou    
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]a 0
[r4-ospf-1-area-0.0.0.0]net    
[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 45.0.0.0 0.0.0.255

 (3)BGP配置

[r1]bgp 1
[r1-bgp]peer 12.0.0.2 as    
[r1-bgp]peer 12.0.0.2 as-number 2
[r1-bgp]net    
[r1-bgp]network 1.1.1.1 32

[r2]bgp 2
[r2-bgp]peer 3.3.3.3 as    
[r2-bgp]peer 3.3.3.3 as-number 2
    
[r2-bgp]peer 3.3.3.3 con    
[r2-bgp]peer 3.3.3.3 connect-interface l0
[r2-bgp]peer 4.4.4.4 as 2
[r2-bgp]peer 4.4.4.4 connect-interface l0
[r2-bgp]peer 12.0.0.1 as 1
[r2-bgp]peer 3.3.3.3 ne    
[r2-bgp]peer 3.3.3.3 next-hop-invariable
[r2-bgp]peer 3.3.3.3 next-hop-local   
[r2-bgp]peer 4.4.4.4 next-hop-local

[r3]bgp 2
[r3-bgp]peer 2.2.2.2 as 2    
[r3-bgp]peer 2.2.2.2 connect-interface l0
[r3-bgp]peer 4.4.4.4 as 2    
[r3-bgp]peer 4.4.4.4 connect-interface l0
[r3-bgp]peer 4.4.4.4 connect-interface l0    
[r3-bgp]network 3.3.3.0 255.255.255.0

[r4]bgp 2
[r4-bgp]peer 2.2.2.2 as 2    
[r4-bgp]peer 2.2.2.2 connect-interface l0
[r4-bgp]peer 3.3.3.3 as 2   
[r4-bgp]peer 3.3.3.3 connect-interface l0  
[r4-bgp]peer 5.5.5.5 as 2
[r4-bgp]peer 5.5.5.5 con     
[r4-bgp]peer 5.5.5.5 connect-interface l0
[r4-bgp]network 4.4.4.0 255.255.255.0    
[r4-bgp]peer 2.2.2.2 next-hop-local
[r4-bgp]peer 3.3.3.3 next-hop-local

[r5]bgp 3
[r5-bgp]peer 4.4.4.4 as 2
[r5-bgp]peer 4.4.4.4 ebgp-    
[r5-bgp]peer 4.4.4.4 ebgp-max-hop 255

[r5-bgp]network 5.5.5.0 255.255.255.0

*以上配置不知道有点问题无法与r5建立邻居

(4)整合路由

[r1]ip ip-prefix aa permit 172.16.0.0 16 greater-equal 24 less-equal 24 
[r1]route-policy-change    
[r1]route-policy aa permit node 10  
[r1-route-policy]if-match ip-prefix aa
 

 

举报

相关推荐

BGP实验

BGp实验

实验四、BGP

BGP配置实验

BGP简单实验

BGP进阶实验

简单BGP实验

BGP实验二

BGP实验案例

0 条评论