当前位置:网站首页>HCIP-第十二天-MPLS+VNP
HCIP-第十二天-MPLS+VNP
2022-08-03 12:50:00 【m0_72586049】
目录
一、实验目的
通过使用BGP边界网关协议和MPLS多协议标签交换以及MPLSVPN让如下图所示的拓扑环境达到实验要求
二、实验需求
1.蓝色区域代表的是公网且AR4和AR7的GE0/0/2和GE0/0/0口也属于蓝色区域范围内
2.红色区域代表A公司的两个不同子公司,紫色代表B公司的子公司(AR4和AR7的GE4/0/0和GE0/0/1口也属于紫色区域),让各公司的两子公司内网可达
3.每个路由器均有一个环回,且B1和B2能上网
三、实验步骤
1.更改设备器名称
以R1为例:
[Huawei]sysname r1
[r1]
2.OSPF宣告
要让公网内部可达,因此需在R2、R3、R4上进行OSPF动态协议配置
以R2为例
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255 
之后进行公网内部测试
3. MPLS配置
以R3为例
[R3]mpls lsr-id 3.3.3.3
[R3]mpls
[R3-mpls]mpls ldp
[R3-mpls-ldp]q
[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

4. MPLSVPN虚拟空间创建
①R2
[R2]ip vpn-instance a
[R2-vpn-instance-a]route-distinguisher 1:1
[R2-vpn-instance-a]vpn-target 1:1
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip binding vpn-instance a
[R2-GigabitEthernet0/0/0]ip address 192.168.2.2 24
[R2]ip vpn-instance b
[R2-vpn-instance-a]route-distinguisher 2:2
[R2-vpn-instance-a]vpn-target 2:2
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip binding vpn-instance b
[R2-GigabitEthernet0/0/1]ip address 192.168.2.2 24

②R4
[R4]ip vpn-instance a
[R4-vpn-instance-a]route-distinguisher 1:1
[R4-vpn-instance-a]vpn-target 1:1
[R4]interface GigabitEthernet 0/0/1
[R4-GigabitEthernet0/0/1]ip binding vpn-instance a
[R4-GigabitEthernet0/0/1]ip address 192.168.3.1 24
[R4]ip vpn-instance b
[R4-vpn-instance-a]route-distinguisher 2:2
[R4-vpn-instance-a]vpn-target 2:2
[R4]interface GigabitEthernet 4/0/0
[R4-GigabitEthernet4/0/0]ip binding vpn-instance b
[R4-GigabitEthernet4/0/0]ip address 192.168.3.1 24
5. 子公司内部OSPF宣告
R2和R4需在自己的VPN-INSTANCE A/B上面进行ospf配置
以R1、R2、R6为例
①R1
[R1]ospf 2 router-id 1.1.1.1
[R1-ospf-2]area 0.0.0.0
[R1-ospf-2-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R1-ospf-2-area-0.0.0.0]network 192.168.2.0 0.0.0.255 ②R2
[R2]ospf 2 vpn-instance a
[R2-ospf-2]area 0
[R2-ospf-2-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[R2]ospf 3 vpn-instance b
[R2-ospf-3]area 0
[R2-ospf-3-area-0.0.0.0]network 192.168.2.0 0.0.0.255 ③R6
[R6]ospf 3 router-id 1.1.1.1
[R6-ospf-3]area 0.0.0.0
[R6-ospf-3-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R6-ospf-3-area-0.0.0.0]network 192.168.2.0 0.0.0.255 测试
6.BGP配置
以R2为例
[R2]bgp 1
[R2-bgp]router-id 2.2.2.2
[R2-bgp]peer 4.4.4.4 as-number 1
[R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R2-bgp]ipv4-family vpnv4
[R2-bgp-af-vpnv4]peer 4.4.4.4 enable 
7.双向重发布
以R2为例
[R2]bgp 1
[R2-bgp]ipv4-family vpn-instance a
[R2-bgp-a]import-route ospf 2
[R2-bgp]ipv4-family vpn-instance b
[R2-bgp-b]import-route ospf 3
[R2]ospf 2
[R2-ospf-2]import-route bgp
[R2]ospf 3
[R2-ospf-3]import-route bgp测试公司是否内网可达

8.NAT转换和缺省路由配置
要让R7上的B2能够进行上网,需在R7配置NAT接口转换,并且进行缺省配置及下放
[R7]acl 2000
[R7-acl-basic-2000]rule 1 permit source any
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000
[R7]ip route-static 0.0.0.0 0 47.1.1.4
[R7]ospf 3
[R7-ospf-3]default-route-advertise always 由于R2没有47.1.1.0网段的路由,因此在R4上进行BGP宣告
[R4]bgp 1
[R4-bgp]network 47.1.1.0 24但因为R3并没有启用BGP协议,因此依旧R7pingR2依旧不可达,需在R3上手写一条缺省路由
[R3]ip route-static 0.0.0.0 0 34.1.1.4测试
由次可得R7已经能够上网,但是B1区域内的R6依旧不行,这是因为R6是通过MPLS的VPN通道先到R7,再通过R7进行上网,所以在MPLS的VPN虚拟链路也需要有缺省路由
[R4]bgp 1
[R4-bgp]ipv4-family vpn-instance b
[R4-bgp-b]default-route imported 四、测试
终上所述:该实验的所有要求已经达成 ,实验成功。
边栏推荐
- 15. PARTITIONS「建议收藏」
- shell编程条件语句
- Nodejs 安装依赖cpnm时,install 出现Error: Cannot find module ‘fs/promises‘
- 秋招招工作
- 使用工作队列管理器(四)
- 力扣刷题 每日两题(一)
- When Nodejs installation depends on cpnm, the install shows Error: Cannot find module 'fs/promises'
- 浅谈低代码平台远程组件加载方案
- 【实战技能】单片机bootloader的CANFD,I2C,SPI和串口方式更新APP视频教程(2022-08-01)
- shell编程之条件语句
猜你喜欢

How to build an overseas purchasing system/purchasing website - source code analysis

基于php网上零食商店管理系统获取(php毕业设计)

Notepad++ 安装jsonview插件
![Tinymce plugins [Tinymce扩展插件集合]](/img/c6/da0782a4c85085cf7b5af86e249408.png)
Tinymce plugins [Tinymce扩展插件集合]

Sogou news - dataset

论文理解:“Gradient-enhanced physics-informed neural networks for forwardand inverse PDE problems“

shell编程条件语句

欧曼自动挡、银河大马力、行星新产品 欧曼全新产品以燎原之势赢领市场

B站回应“HR 称核心用户都是 Loser”:该面试官去年底已被劝退,会吸取教训加强管理

什么是分布式锁?几种分布式锁分别是怎么实现的?
随机推荐
类和对象(中下)
Tinymce plugins [Tinymce扩展插件集合]
基于php网上零食商店管理系统获取(php毕业设计)
Yahoo!Answers - data set
Key points for account opening of futures companies
Sogou news-数据集
VLAN 实验
Autumn recruitment work
力扣刷题 每日两题(一)
Golang 互斥锁
新评论接口——京东评论接口
[微服务]多级缓存
Sogou news - dataset
[R] Use grafify for statistical plotting, ANOVA, intervention comparisons, and more!
期货开户中常见问题汇总
安全自定义 Web 应用程序登录
An动画基础之元件的影片剪辑效果
PyTorch构建神经网络预测气温(数据集对比,CPU与GPU对比)
云计算服务主要安全风险及应对措施初探
PyTorch框架训练线性回归模型(CPU与GPU环境)


