HCIP-15.2.15 BGP综合实验(下)

数通
int loop 0
 ospf network-type broadcast

ospf network-type broadcast使得ospf学习环回接口的路由不是32位,而是24位掩码。

R3:

ip route-s 10.1.0.0 16 NULL 0
#
bgp 100
 network 10.1.0.0 16
 network 10.1.4.0 24
 netw 10.1.7.0 24

R5:

ip route-s 10.1.0.0 16 NULL 0
#
bgp 100
 netw 10.1.0.0 16
 netw 10.1.4.0 24
 netw 10.1.7.0 24

R3:将办公和汇总路由传递给R1时更改MED值为88,使得R1优选②号专线访问办公网段和其他网段

ip ip-prefix BanGong_Sheng permit 10.1.7.0 24 gr 24 le 24
ip ip-prefic Qita permit 10.1.0.0 16 gr 16 le 16
#

route-policy MED permit no 10
if-ma BanGong_Sheng
apply cost 88
route-policy MED permit no 20
if-ma Qita
apply cost 88
route-policy MED permit no 99  # 放行其他路由
#

bgp 100
 peer 200.1.13.1 route-policy MED export

R5:将业务路由传递给R2时,将MED值改为88,使得R2优选②号线路访问业务

ip ip-pre Yewu_Sheng permit 10.1.4.0 24 gr 24 le 24
#
route-policy MED per no 10
 if-ma ip-p Yewu_Sheng
 app cos 88
route-po MED per no 99
#

bgp 100
 peer 200.1.25.2 route-po MED ex

调试命令:

refresh bgp all export
refresh bgp all import

R1:

ip route-s 10.2.0.0 16 NULL 0
#
bgp 200
 netw 10.2.6.0 24
 netw 10.2.7.0 24
 netw 10.2.0.0 16

R2:

ip route-s 10.2.0.0 16 NULL 0
#
bgp 200
 netw 10.2.6.0 24
 netw 10.2.7.0 24
 netw 10.2.0.0 16

R3:针对地市1 AS200办公和汇总路由,将其从R1收来时,增加as-path使其优选R5,走②号专线访问地市1办公和汇总网段

ip ip-p Bangong_Dishi1 permit 10.2.7.0 24 gr 24 le 24
ip ip-p Qita_Dishi1 per 10.2.0.0 16 gr 16 le 16
#

route-policy AS-Path per node 10
if-ma ip-p Bangong_Dishi1
app as-path 200 200 additive

route-policy AS-Path per no 20
if-ma ip-p Qita_Dishi1 
app as-path 200 200 additive

route-policy AS-path per no 99

bgp 100
 peer 200.1.13.1 route-policy AS-Path import # import方向

R5:从R2收来的业务路由增加AS_Path,使得R5优选R3经过①号专线到达业务网段

ip ip-p Yewu_Dishi1 per 10.1.6.0 24
route-policy AS-Path per node 10
 if-ma ip-p Yewu_Dishi1
 apply as-path 200 200 addi

route-policy AS-Path per node 99

bgp 100
 peer 200.1.25.2 route-policy AS-Path import # import方向

638

R1&R2:将BGP路由引入到OSPF中,使得R6等下属单位通过OSPF学习到省级(AS100)的路由

ospf 1
 import-route bgp type 1

R3&R5:将BGP引入OSPF,让R4通过OSPF学习到地市1(AS200)的路由

ospf 1 
 import-route bgp type 1   # type 1 沿途累加cost

6.16-102

优先R2传给R1的OSPF路由

以上为【双点单向】引入,【双点双向】引入会有路由环路

故障测试:

6.16-15

  • 删除任何一条专线,查看路径是否能够切换
  • R1、R3掉电或硬件故障(收敛时间较长)
<R6>tracert -a 10.2.6.6 10.1.4.4 # 业务
    tracert -a 10.1.7.6 10.1.7.4 # 办公

不拔线、不shutdwon接口断开BGP邻居关系(运营商测试专线丢包时需要)

R1:

bgp 200
 # 方法1
 nei 200.1.13.3 shutdown
 # 方法2
 peer 200.1.13.3 ignore
本文链接:https://www.orcy.net.cn/4167.html,转载请附上原文出处链接

暂无评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注