HCIP-BGP选路实验

实验拓扑

HCIP-BGP选路实验_第1张图片

实验需求 

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之间通信

实验思路

配置OSPF协议

配置BGP

路由引入

线路优化

实验步骤

配置ip地址

以R2为例

[Huawei]sys r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
Jan 26 2024 16:58:21-08:00 r2 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]int g0/0/01
[r2-GigabitEthernet0/0/1]ip address 23.1.1.1 24
Jan 26 2024 16:59:02-08:00 r2 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r2-GigabitEthernet0/0/1]int g0/0/02
[r2-GigabitEthernet0/0/2]ip address 25.1.1.1 24
Jan 26 2024 16:59:39-08:00 r2 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[r2-GigabitEthernet0/0/2]int l0
[r2-LoopBack0]ip address 2.2.2.2 32

配置OSPF协议

以R2为例

[r2] ospf 1 rou	
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 23.1.1.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 25.1.1.1 0.0.0.0

配置BGP

以R2为例

[r2]bgp 64512
[r2-bgp]confederation id  200
[r2-bgp]confederation peer-as 64513
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 3.3.3.3 as-number 64512
[r2-bgp]peer 3.3.3.3 connect-interface l0
[r2-bgp]peer 5.5.5.5 as-number 64513
[r2-bgp]peer 5.5.5.5 connect-interface l0
[r2-bgp]peer 5.5.5.5 ebgp-max-hop 
[r2-bgp]peer 12.1.1.1 as-number 100

路由引入

以R2为例

[r2]bgp 64512
[r2-bgp]import-route direct 

线路优化

以R7为例

[Huawei]ip ip-prefix xx permit 4.4.4.4 32
[Huawei]route-policy yy permit node 10
Info: New Sequence of this List.
[Huawei-route-policy]if-match ip-prefix xx
[Huawei-route-policy]apply preferred-value 1
[Huawei-route-policy]q
[Huawei]route-policy yy permit node 20
Info: New Sequence of this List.
[Huawei-route-policy]q
[Huawei]bgp 64513
[Huawei-bgp]peer 4.4.4.4 route-policy yy import 

你可能感兴趣的:(网络,实验,HCIP,网络)