当前位置:网站首页>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
四、测试
终上所述:该实验的所有要求已经达成 ,实验成功。
边栏推荐
- 软件测试面试(四)
- 图像融合GAN-FM学习笔记
- In order to counteract the drop in sales and explore the low-end market, Weilai's new brand products are priced as low as 100,000?
- How does Filebeat maintain file state?
- R language ggplot2 visualization: use the patchwork bag plot_layout function will be more visual image together, ncol parameter specifies the number of rows, specify byrow parameters configuration dia
- 汉源高科G8032标准ERPS环网交换机千兆4光10电工业以太网交换机环网+WEB管理+SNMP划VLAN
- B站回应“HR 称核心用户都是 Loser”:该面试官去年底已被劝退,会吸取教训加强管理
- GameFi industry down but not out | June Report
- 【实战技能】单片机bootloader的CANFD,I2C,SPI和串口方式更新APP视频教程(2022-08-01)
- 实数取整写入文件(C语言文件篇)
猜你喜欢
How to disable software from running in the background in Windows 11?How to prevent apps from running in the background in Windows 11
基于php校园医院门诊管理系统获取(php毕业设计)
PyTorch构建分类网络模型(Mnist数据集,全连接神经网络)
An animation basic element movie clip effect
An introduction to the width tool, deformation tool and lasso tool
PyTorch构建神经网络预测气温(数据集对比,CPU与GPU对比)
【OpenCV】 级联分类器训练模型
Sogou news - dataset
Key points for account opening of futures companies
YOLOv5 training data prompts No labels found, with_suffix is used, WARNING: Ignoring corrupted image and/or label appears during yolov5 training
随机推荐
When Nodejs installation depends on cpnm, the install shows Error: Cannot find module 'fs/promises'
PyTorch框架训练线性回归模型(CPU与GPU环境)
Oracle安装完毕(系统盘),从系统盘转移到数据盘
An动画优化之传统引导层动画
Sogou news-数据集
基于php志愿者服务平台管理系统获取(php毕业设计)
Golang 字符串
技术分享 | 接口自动化测试如何搞定 json 响应断言?
self-discipline
【深度学习】高效轻量级语义分割综述
Golang 字典 map
An工具介绍之骨骼工具
实数取整写入文件(C语言文件篇)
IronOS, an open source system for portable soldering irons, supports a variety of portable DC, QC, PD powered soldering irons, and supports all standard functions of smart soldering irons
类和对象(中上)
An introduction to the skeleton tool
【R】用grafify搞定统计绘图、方差分析、干预比较等!
链游NFT元宇宙游戏系统开发技术方案及源码
海外代购系统/代购网站怎么搭建——源码解析
使用工作队列管理器(三)