BGP邻居路由黑洞+mpls ip

简介: 文章目录要求:拓扑:命令:

要求:

R1与R5通信

拓扑:


命令:

R1:
R1(config)#interface e0/0
R1(config-if)#ip add 12.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#interface lo0
R1(config-if)#ip add 
R1(config-if)#ip add 1.1.1.1 255.255.255.255 
R1(config-if)#no sh
R1(config)#router bgp 1
R1(config-router)#neighbor 12.1.1.2 remote-as 234
R1(config-router)#network 1.1.1.1 mask 255.255.255.255
R2:
R2(config)#interface e0/0
R2(config-if)#ip add 12.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#interface e0/1
R2(config-if)#ip add 23.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#interface loo0
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#no sh
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2 
R2(config-router)#network 23.1.1.2 0.0.0.0 area 0
R2(config-router)#network 2.2.2.2 0.0.0.0 area 0
R2(config)#router bgp 234
R2(config-router)#neighbor 12.1.1.1 remote-as 1
R2(config-router)#network 2.2.2.2 mask 255.255.255.255
R2(config-router)#neighbor 4.4.4.4 remote-as 234
R2(config-router)#neighbor 4.4.4.4 update-source Loopback0
R2(config-router)#neighbor 4.4.4.4 next-hop-self
R3(config)#interface e0/0
R3(config-if)#ip add 23.1.1.3 255.255.255.0  
R3(config-if)#no sh
R3(config-if)#interface e0/1
R3(config-if)#ip add 34.1.1.3 255.255.255.0 
R3(config-if)#no sh
R3(config-if)#interface lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.255
R3(config-if)#no sh
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3   
R3(config-router)#network 3.3.3.3 0.0.0.0 area 0
R3(config-router)#network 23.1.1.3 0.0.0.0 area 0
R3(config-router)#network 34.1.1.3 0.0.0.0 area 0
R4(config)#interface e0/0
R4(config-if)#ip add 34.1.1.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#interface e0/1
R4(config-if)#ip add 45.1.1.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#interface loo0
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config-if)#no sh
R4(config)#router ospf 1
R4(config-router)#router-id 4.4.4.4 
R4(config-router)#network 4.4.4.4 0.0.0.0 area 0 
R4(config-router)#network 34.1.1.4 0.0.0.0 area 0
R4(config)#interface lo40
R4(config-if)#ip add 40.1.1.1 255.255.255.255
R4(config-if)#no sh
R4(config)#ip route 50.1.1.1 255.255.255.255 45.1.1.5
R4(config)#router bgp 234
R4(config-router)#nei 50.1.1.1 remote-as 5
R4(config-router)#nei 50.1.1.1 ebgp-multihop 255
R4(config-router)#neighbor 50.1.1.1 update-source lo40
R4(config-router)#neighbor 2.2.2.2 remote-as 234
R4(config-router)#neighbor 2.2.2.2 update-source lo0
R4(config-router)#neighbor 2.2.2.2 next-hop-self
R5(config)#interface e0/0
R5(config-if)#ip add 45.1.1.5 255.255.255.0
R5(config-if)#no sh
R5(config-if)#int lo0
R5(config-if)#ip add 5.5.5.5 255.255.255.255
R5(config-if)#no sh
R5(config)#interface lo50
R5(config-if)#ip add 50.1.1.1 255.255.255.255
R5(config-if)#no sh
R5(config)#ip route 40.1.1.1 255.255.255.255 45.1.1.4
R5(config)#router bgp 5
R5(config-router)#network 5.5.5.5 mask 255.255.255.255
R5(config-router)#neighbor 40.1.1.1 remote-as 234 
R5(config-router)#neighbor 40.1.1.1 ebgp-multihop 255
R5(config-router)#neighbor 40.1.1.1 update-source lo50



通过查看R3路由表发现没有路由

想要R1与R5通信现有3种办法

R3运行ibgp全互联

重分布

完美解决路由黑洞的方案:mpls多协议标签交换

1的缺点:如果有多个R3路由器,邻居关系太多,配置复杂,对设备要求高,需要都运行BGP。

2的缺点:BGP路由太多, redis到igp ,会导致igp路由爆炸。


R2:
R2(config)#mpls ip
R2(config)#int e0/1
R2(config-if)#mpls ip
R3:
R3(config)#mpls ip 
R3(config)#int e0/0
R3(config-if)#mpls ip
R3(config-if)#int e0/1
R3(config-if)#mpls ip 
R3(config-if)#
R4:
R4(config)#mpls ip 
R4(config)#mpls ldp router-id lo0 force
R4(config)#int e0/0
R4(config-if)#mpls ip

目录
相关文章
|
4月前
|
网络协议
使用MPLS LDP解决BGP路由黑洞的问题
MPLS LDP默认不为BGP路由分配标签
|
7月前
|
网络架构
交换机与路由器技术-21-RIP路由协议
交换机与路由器技术-21-RIP路由协议
39 0
|
网络架构
BGP路由技术(二)
⭐本文介绍⭐ BGP(Border Gateway Protocol,边界网关协议)是一个路径矢量路由协议,和传统的基于下一跳的IGP协议不同,它是基于AS(自治系统)的协议。BGP属于外部网关路由协议,它解决的是AS之间的选路问题,也正因为这样,它更适合与互联网。学习BGP的关键在于理解BGP的报文,邻居建立,BGP路由属性,选路原则等。本文将对以上各项知识、工作原理及相关的配置做介绍。
BGP路由技术(二)
|
网络协议 数据库 网络架构
BGP路由技术(一)
⭐本文介绍⭐ BGP(Border Gateway Protocol,边界网关协议)是一个路径矢量路由协议,和传统的基于下一跳的IGP协议不同,它是基于AS(自治系统)的协议。BGP属于外部网关路由协议,它解决的是AS之间的选路问题,也正因为这样,它更适合与互联网。学习BGP的关键在于理解BGP的报文,邻居建立,BGP路由属性,选路原则等。本文将对以上各项知识、工作原理及相关的配置做介绍。
BGP路由技术(一)
|
网络协议 算法 数据库
|
网络协议 网络架构
二、IP、路由协议
二、IP、路由协议
二、IP、路由协议
|
网络协议 网络架构 iOS开发
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(下)
文章目录 系列文件 概述 BGP AS BGP 邻居 BGP 更新源 BGP TTL BGP路由表 BGP 同步
353 0
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(下)
|
网络协议 算法 数据库
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(上)
文章目录 系列文件 概述 BGP AS BGP 邻居 BGP 更新源 BGP TTL BGP路由表 BGP 同步
296 0
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(上)
|
网络协议 网络架构