MPLS VPN 实验

news2024/9/20 8:59:28

目录

MPLS VPN 实验 

拓扑图

实验目的

基础配置

R2

R3

R4

公网部分配置IGP(ospf)

R2

R3

R4

激活MPLS

R2

R3

R4

VRF创建

R2

R4

将接口画入VRF空间

R2

R4

配置接口IP地址

R2

R4

站点1基本配置

站点2基本配置

通过静态路由在CE和PE上配置

启动BGP

建立MP-BGP邻居

发布站点1信息

发布直连路由以及静态路由

测试​编辑

发布站点2的路由信息

发布路由(neetwork发布)

测试

 连通性测试


MPLS VPN 实验 

拓扑图

实验目的

        站点1与站点2需要通过MPLS VPN搭建到一起         

R2、R4--- PE

R3 --- P

R1、R5 --- CE

基础配置

R2

[R2]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              unassigned           up         down      
GigabitEthernet0/0/1              23.0.0.1/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         2.2.2.2/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[R2]

R3

[R3]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              23.0.0.2/24          up         up        
GigabitEthernet0/0/1              24.0.0.1/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         3.3.3.3/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[R3]

R4

[R4]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              34.0.0.2/24          up         up        
GigabitEthernet0/0/1              unassigned           up         down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         4.4.4.4/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[R4]

公网部分配置IGP(ospf)

R2

[R2]ospf router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

R3

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

R4

[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0

激活MPLS

R2

[R2]mpls lsr-id 2.2.2.2
[R2]mpls 
Info: Mpls starting, please wait... OK!
[R2-mpls]mpls ld
[R2-mpls-ldp]  int g 0/0/01
[R2-GigabitEthernet0/0/1]mpls 
[R2-GigabitEthernet0/0/1]mpls ld

R3

[R3]mpls lsr-id 3.3.3.3
[R3]mpls 
Info: Mpls starting, please wait... OK!
[R3-mpls]mpls ldp
[R3-mpls-ldp]int g 0/0/0
[R3-GigabitEthernet0/0/0]mpls 
[R3-GigabitEthernet0/0/0]mpls ldp
[R3-GigabitEthernet0/0/0]int g 0/0/1	
[R3-GigabitEthernet0/0/1]mpls 
[R3-GigabitEthernet0/0/1]mpls ldp 
[R3-GigabitEthernet0/0/1]

R4

[R4]mpls lsr-id 4.4.4.4
[R4]mpls 
Info: Mpls starting, please wait... OK!
[R4-mpls]mpls ldp
[R4-mpls-ldp]int g 0/0/0	
[R4-GigabitEthernet0/0/0]mpls 	
[R4-GigabitEthernet0/0/0]mpls ldp 
[R4-GigabitEthernet0/0/0]

VRF创建

R2

[R2]ip vpn-instance a --- VRF空间命名时大小写敏感
[R2-vpn-instance-a]
[R2-vpn-instance-a]route-distinguisher 100:1 --- 配置RD值
[R2-vpn-instance-a-af-ipv4]
[R2-vpn-instance-a-af-ipv4]vpn-target 100:1 export-extcommunity --- 配置出站RT
 EVT Assignment result: 
Info: VPN-Target assignment is successful.
[R2-vpn-instance-a-af-ipv4]vpn-target 100:2 import-extcommunity --- 配置入站RT
 IVT Assignment result: 
Info: VPN-Target assignment is successful.

R4

[R4]ip vpn-instance b
[R4-vpn-instance-b]
Apr 19 2023 11:44:15-08:00 R4 %%01LDP/4/SSNHOLDTMREXP(l)[1]:Sessions were delete
d because the session hold timer expired and the notification of the expiry was 
sent to the peer 3.3.3.3. 
[R4-vpn-instance-b]route-distinguisher 200:1	
[R4-vpn-instance-b-af-ipv4]vpn-target 100:2 export-extcommunity 
 EVT Assignment result: 
Info: VPN-Target assignment is successful.
[R4-vpn-instance-b-af-ipv4]vpn-target 100:1 import-extcommunity 
 IVT Assignment result: 
Info: VPN-Target assignment is successful.
[R4-vpn-instance-b-af-ipv4]

将接口画入VRF空间

R2

[R2-GigabitEthernet0/0/0]ip binding vpn-instance a
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[R2-GigabitEthernet0/0/0]

R4

[R4-GigabitEthernet0/0/1]ip binding vpn-instance b
Apr 19 2023 11:46:19-08:00 R4 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the DOWN state. 
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[R4-GigabitEthernet0/0/1]

注意:

        画入后会清除之前配置的所有IPV4、IPV6

配置接口IP地址

R2

[R2-GigabitEthernet0/0/0]ip address 192.168.2.2 24

R4

[R4]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.3.1 24

站点1基本配置

[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip ad	
[R1-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[R1]int l 0
[R1-LoopBack0]ip address 192.168.1.1 24

站点2基本配置

[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.3.2 24
[R5-LoopBack0]ip address 192.168.4.1 24

通过静态路由在CE和PE上配置

[R1]ip route-static 192.168.3.0 24 192.168.2.2
[R1]ip route-static 192.168.4.0 24 192.168.2.2

[R2]ip route-static vpn-instance a 192.168.1.0 24 192.168.2.1

[R5]ip route-static 192.168.2.0 24 192.168.3.1
[R5]ip route-static 192.168.1.0 24 192.168.3.1

[R4]ip route-static vpn-instance b 192.168.4.0 24 192.168.3.2

启动BGP

        使用IBGP即可

[R2]bgp 1
[R2-bgp]router-id 2.2.2.2
[R2-bgp]peer 4.4.4.4 as 1
[R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0

[R4]bgp 1
[R4-bgp]router-id 4.4.4.4
[R4-bgp]peer 2.2.2.2 as 1
[R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0

建立MP-BGP邻居

        在BGPV4邻居关系建立好之后进入到VPNV4

[R2-bgp]ipv4-family vpnv4
[R2-bgp-af-vpnv4]
[R2-bgp-af-vpnv4]peer 4.4.4.4 enable --- 因为PE设备之间需要传递VPNV4路由 ,所以,在普通的BGPV4邻居关系建立的基础上,需要在VPNV4地址族中激活邻居关系

[R4-bgp]ipv4-family vpnv4
[R4-bgp-af-vpnv4]peer 2.2.2.2 enable

发布站点1信息

[R2-bgp]ipv4-family vpn-instance a --- 在VRF空间中发布路由信息

发布直连路由以及静态路由

[R2-bgp-a]import-route direct 
[R2-bgp-a]import-route static

测试

发布站点2的路由信息

[R4-bgp]ipv4-family vpn-instance b

发布路由(neetwork发布)

[R4-bgp-b]network 192.168.3.0 24
[R4-bgp-b]network 192.168.4.0 24

测试

 连通性测试

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/449014.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【SPSS】两独立样本的极端反应检验和两配对样本的非参数检验详细操作教程(附案例实战)

🤵‍♂️ 个人主页:艾派森的个人主页 ✍🏻作者简介:Python学习者 🐋 希望大家多多支持,我们一起进步!😄 如果文章对你有帮助的话, 欢迎评论 💬点赞&#x1f4…

链式二叉树的查找,遍历(递归实现)等接口的实现

目录 前言: 一:二叉树的建立 (1)本文采用的二叉树表示方法 (2)手动建立一颗二叉树 二:二叉树的遍历 (1)二叉树的三种遍历方式 (2)分治思想 (3)前序遍历 (4)中序遍历 (5)后序遍历 三:求二叉树的节点和高度(深度) (1)求二叉树节点 ①…

python+vue 餐饮食品安全监管投诉平台

系统主要包括个人中心、用户管理、餐饮类型管理、餐饮企业管理、案例类型管理、案例展示管理、法规分类管理、法律法规管理、在线投诉管理、查处信息管理、系统管理等功能模块。 绪论 网站的开发背景,意义和系统状况等,详细讲述了系统的用处,…

基于构效关系模型的药物设计(QSAR)

基于构效关系模型的药物设计(QSAR) 定量构效关系(QSAR,Quantitative Structure-Activity Relationship)分析是指利用理论计算和统计分析工具来研究系列化合物结构(包括二维分子结构、三维分子结构和电子结…

Latex数学公式排版

文章目录 Latex使用最佳方式:读官方文档Latex中的字符数学公式排版1.引入宏包:2.公式排版基础3.数学符号(1).希腊字母(2).指数,上下标,导数(3).分式和根式(4).关系符(5).算符(6).巨算符(7).箭头 Latex使用 最佳方式:读官方文档 The not so short intro…

案例分析:真实案例对“引用类型”的思考

在一个风和日丽的早上,我刚坐到工位上,正准备美美的享受早餐时,我的测试小兄弟杨过火急火燎的来找我说:“小米,不好了,运营童鞋反馈,咱们商城小程序金刚区的新店专区,新开的店铺无法…

mac上 qt与mysql的连接问题

经过两天的折磨和挣扎,将Mac上QT与mysql数据库链接问题的解决做一个梳理,以防忘记,并供他人借鉴; 环境版本:Mac10.14,MySQL5.7.24,Qt5.14.2 首先我重新下载安装了Qt(安装了源码&am…

Hadoop课程笔记

Hadoop笔记 nn和sn的区别 nn有inprogress,sn没有,隔一段时间sn会拉取nn上的fsi和edits进行合并然后返回给nnnn和dn 序列化和反序列化 当需要将内存中对象从一个服务器传输到另一个服务器的时候,将内存中的对象写进磁盘(序列化&am…

python知识点总结(国家一级假勤奋大学生整理)

python知识点总结 0. 持续更新~1. print不加end自动加回车自动换行2. eval()提取值3. 三双引号字符串中可以包含换行符,制表符以及其他特殊字符4. 字符串不能修改5. 用in 或 not in判断字串是否在母串中6. 网上做题print慎用‘,’会产生不该有的空格7. i…

职场规则实录(不要成全别人,恶心自己)

即使我们因为做出某种决定失去了某些东西,但这并不一定意味着这个决定是错误的。相反,很多时候,即使我们面临诸多风险,我们也要冒险去做出决定,因为在这种风险中可能存在着丰富的机会和收获。就像投资一样,就算我们的投资并没有获得预期的收益,但这并不代表这个投资是错…

Linux 性能优化大全!

性能指标 高并发和响应快对应着性能优化的两个核心指标:吞吐和延时 应用负载角度:直接影响了产品终端的用户体验 系统资源角度:资源使用率、饱和度等 性能问题的本质就是系统资源已经到达瓶颈,但请求的处理还不够快&#xff0…

【超算/先进计算学习】日报5

目录 今日已完成任务列表遇到的问题及解决方案任务完成详细笔记程序性能分析程序流程分析程序静态分析工具 understand程序性能动态分析工具 gprof-使用方式程序性能动态分析工具 gprof-输出结果详解程序性能动态分析工具 gropf-函数调用关系图程序动态分支辅助方式-计时函数其…

git版本控制

git版本控制 time:2023-04-18 版本控制 集中式版本控制 多人协作开发 创建仓库 使用当前目录作为 Git 仓库,我们只需使它初始化。 git init使用我们指定目录作为Git仓库。 git init newrepo克隆远程仓库 git clone https://gitee.com/zhang-min…

银行数字化转型导师坚鹏:银行数字化创新应用与案例分析

银行数字化创新应用与案例分析 课程背景: 很多银行存在以下问题: 不知道如何进行数字化创新? 不知道金融科技在银行业的重要应用? 不清楚银行同业的数字化创新有哪些案例? 课程特色: 用独特视角…

在C上++ -- 函数重载与引用

一、函数重载 函数重载:是函数的一种特殊情况,C允许在同一作用域中声明几个功能类似的同名函数,这 些同名函数的形参列表(参数个数 或 类型 或 类型顺序)不同,常用来处理实现功能类似数据类型 不同的问题。 简单来说&#xff1a…

点云处理及三维重建软件(Point Cloud Viewer, PCV)的设计与实现

GitHub 地址:point-cloud-viewer 文章目录 使用教程以及相关工具库Step 1 搭建环境Step 2 使用Cmake构建工程Step3 使用VS 编写code并编译执行 点云处理及三维重建软件(PCV)的设计与实现一, 软件总体设计1.1 软件设计流程需求分析总体设计技术选型详细设…

【RestFul系列】RestFul学习笔记

目录 一、REST定义 二、REST架构的主要原则 三、RESTful介绍 1、资源(Resources) 2、 表现层(Representation) 3、 状态转化(State Transfer) 四、RESTful的使用 1、RESTful资源操作 2、接口示例&…

verilog设计实现8b-10b编码器包括3b4b,5b6b 及modelsim仿真

下面是8b10b编码器的设计步骤。 确定数据输入和输出接口。例如,您需要确定8位并行数据输入和10位串行数据输出。 计算数据带宽。这与芯片中可用的时钟速度密切相关。 选择编码表。根据应用选择最佳编码表,8b10b编码器至少应使用一张编码表。详细了解和选择编码表有利于改善编…

图的存储及基本操作总结(邻接矩阵、邻接表)及C/C++代码实现

文章目录 前言一、邻接矩阵1.概念2.图像示例3. 代码实现注意邻接矩阵的特点 二、邻接表1.概念2.图像示例3.代码实现邻接表的特点 前言 图是一种比较复杂的数据结构,每个结点之间可以有多种关系。 所以,一个图可以呈现出千奇百怪的形式。 对于不同的形式…

使用FFMPEG库将YUV编码为H264

准备 ffmpeg 4.4 p准备一段yuv420p的格式的视频原始数据 这里我们使用命令直接提取 ffmpeg -i .\beautlWorld.mp4 -pixel_format yuv420p -s 1280x720 yuv420p_1280x720.yuv 编码流程 大致可以分为以下几步: 1.初始化编码器并设置参数 2.初始化AVPacket和AVFr…