当前位置:网站首页>HCIP-第十一天-MPLS+BGP
HCIP-第十一天-MPLS+BGP
2022-08-02 03:16:00 【m0_72586049】
目录
一、实验目的
通过使用BGP边界网关协议和MPLS多协议标签交换让如下图所示的拓扑环境达到实验要求
二、实验需求
1.AS2的ip地址为172.16.0.0/16,且AS2的每台设备存在两个环回接口,一个环回专门建立邻居关系的32位,一个代表用户网段的24位
2.AS2的R3/4/6不得运行BGP协议,IBGP环境通过OSPF达到内部可达
3.R1到AS2中R2/3/4用户网段基于R5访问,到达AS2中的R5/6/7用户网段基于R2访问
4.保留备份路由
5.R1/8的环回均可以访问内部AS2中所有用户网段的环回
三、实验步骤
1.更改设备器名称
以R1为例:
[Huawei]sysname r1
[r1]
2.OSPF宣告
以R2和R3为例
①R2
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
②R3
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
3.更改接口网络类型
由于在OSPF协议中学到的环回网段的子网掩码为32位,而用户网段的子网掩码为24位,因此需要更改AS2环回地址的网络类型
以R2为例
[R2]int LoopBack 0
[R2-LoopBack0]ospf network-type broadcast
4.BGP协议
以R1和R2为例
①R1
[R1]bgp 1
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.1.1.2 as-number 2
[R1-bgp]peer 15.1.1.5 as-number 2
[R1-bgp]network 10.1.1.0 255.255.255.0
②R2
[R2]bgp 2
[R2-bgp]router-id 172.16.1.2
[R2-bgp]peer 12.1.1.1 as-number 1
[R2-bgp]peer 172.16.1.5 as-number 2
[R2-bgp]peer 172.16.1.5 connect-interface LoopBack0
[R2-bgp]peer 172.16.1.7 as-number 2
[R2-bgp]peer 172.16.1.7 connect-interface LoopBack0
[R2-bgp]peer 172.16.1.5 next-hop-local
[R2-bgp]peer 172.16.1.7 next-hop-local
[R2-bgp]network 172.16.0.0 20
5.MPLS协议
由于实验要求,若R2和R7不直连建邻,为了防止BGP协议的路由黑洞的产生,我们需在R3、R4、R6上配置MPLS协议
以R3为例
[R3]mpls lsr-id 172.16.1.3
[R3]mpls
[R3]mpls ldp
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]mpls
[R3-GigabitEthernet0/0/0]mpls ldp
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]mpls
[R3-GigabitEthernet0/0/1]mpls ldp
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]mpls
[R3-GigabitEthernet0/0/2]mpls ldp
且为了让通过BGP学习到的路由条目可以分配标签号,需开启华为设备的route recursive-lookback tunnel路由基于隧道进行递归查找
以R2为例
[R2]route recursive-lookup tunnel
6.空接口防环
根据实验需求,为了让R2、R5和R7BGP宣告的172.16.0.0 20网段不产生路由黑洞,因此建立空接口防环
以R2为例
[R2]ip route-static 172.16.0.0 20 NULL 0
7.缺省路由
由于实验要求,需R1可以ping通AS2任意客户网段,因此需在R3、R4、R6上配置缺省路由
以R3为例
[R3]ip route-static 0.0.0.0 0 172.16.0.1
8.路由策略
为了让R1访问R2/3/4用户网段的流量从R5走,需在R2上BGP宣告R2/R3/R4用户网段,这样导致访问R2/3/4网段的MED值变大,此时R1就会优先走R5,但是因为R1和R2是直连,所以R1访问R2的环回时依旧走R2这条路,因此需要更改172.16.2.0 24这条网段的MED值,R5也依旧如此
以R2为例
R2
[R2]ip ip-prefix a permit 172.16.2.0 24
[R2]route-policy med permit node 10
[R2-route-policy]if-match ip-prefix med
[R2-route-policy]apply cost 10
[R2]route-policy med permit node 20
在R2上进行更改
[R2]bgp 2
[R2-bgp]peer 12.1.1.1 route-policy med export
更改之后查看R1的路由信息
四、测试
终上所述:该实验的所有要求已经达成 ,实验成功。
边栏推荐
- Go语学习笔记 - gorm使用 - 事务操作 Web框架Gin(十一)
- (转帖)HashCode总结(1)
- 7-40 奥运排行榜 (25 分)多项排序
- Lua安装及常用命令使用
- Go语学习笔记 - gorm使用 - 表增删改查 Web框架Gin(八)
- Good Key, Bad Key (thinking, temporary exchange, classic method)
- Daily practice------There are n integers, so that the previous numbers are moved back m positions in order, and the last m numbers become the first m numbers
- 自定义mvc框架复习(crud)
- 知识体系树
- dropout
猜你喜欢
R16 Type II量化反馈码本的产生
知识体系树
自定义mvc框架复习(crud)
Hit the programmer interview scene: What did Baidu interviewers ask me?
Daily practice------There are n integers, so that the previous numbers are moved back m positions in order, and the last m numbers become the first m numbers
JunitTest单元测试
MySQL8--Windows下使用msi(图形界面)安装的方法
mysql8.0.28 download and installation detailed tutorial, suitable for win11
什么是轮式里程计
嵌入式分享合集25
随机推荐
MySQL8 - use under Windows package installation method
day11--shell脚本
MySQL中的各种锁(行锁、间隙锁、临键锁等等LBCC)
DAY-1 | 求两个正整数的最大公约数与最小公倍数之和——辗转相除法
关于跨域问题
STM32——LCD—TFTLCD原理与配置介绍
MySQL8.0.26安装配置教程(windows 64位)
(Repost) HashCode Summary (1)
R16 Type II量化反馈码本的产生
2022.7.30 js notes Operators and flow controllers, loops
LeetCode:1161. 最大层内元素和【BFS层序遍历】
(转帖)hashcode和equals的关系
CentOS7安装Oracle数据库的全流程
Day34 LeetCode
iVX低代码平台系列详解 -- 概述篇(二)
第十一天&shell脚本
WebShell connection tools (Chinese kitchen knife, WeBaCoo, Weevely) use
聊聊flink的BoundedOutOfOrdernessTimestampExtractor
Go语学习笔记 - gorm使用 - gorm处理错误 Web框架Gin(十)
知识体系树