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

目录
相关文章
|
9月前
|
网络协议
使用MPLS LDP解决BGP路由黑洞的问题
MPLS LDP默认不为BGP路由分配标签
|
4月前
|
网络协议 网络虚拟化 网络架构
【网络实验】/主机/路由器/交换机/网关/路由协议/RIP+OSPF/DHCP(上)
【网络实验】/主机/路由器/交换机/网关/路由协议/RIP+OSPF/DHCP(上)
103 1
|
4月前
|
网络协议 数据安全/隐私保护 网络虚拟化
【网络实验】/主机/路由器/交换机/网关/路由协议/RIP+OSPF/DHCP(下)
【网络实验】/主机/路由器/交换机/网关/路由协议/RIP+OSPF/DHCP(下)
97 0
|
8月前
|
网络架构
|
9月前
|
网络协议
OSPF,RIP和BGP的路由汇总
OSPF,RIP和BGP的路由汇总
136 0
|
9月前
|
存储 负载均衡 网络协议
BGP 技术连载:BGP 选路规则
【4月更文挑战第23天】
567 0
|
9月前
|
网络架构
|
9月前
|
负载均衡 网络协议 算法
IP路由协议(RIP、IGRP、OSPF、IS-IS、BGP)
1、路由分类 路由产生方式: 直接路由:路由器会自动生成本路由器激活端口所在网段的路由条目 静态路由:网络管理员手工配置,静态路由信息在缺省的情况下私有的,不会传递给其他的路由器
|
监控 测试技术
转发路由器
转发路由器(Transit Router,简称TR)是地域范围内企业级核心转发网元
115 6
|
9月前
|
缓存 算法 网络架构
【网络层】IP组播(多播)、硬件组播、IGMP、组播路由选择协议、移动IP、路由器详解、路由表和路由转发
【网络层】IP组播(多播)、硬件组播、IGMP、组播路由选择协议、移动IP、路由器详解、路由表和路由转发
196 0