当前位置:网站首页>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
四、测试
终上所述:该实验的所有要求已经达成 ,实验成功。
边栏推荐
- 类和对象(中下)
- 查看GCC版本_qt版本
- 为冲销量下探中低端市场,蔚来新品牌产品定价低至10万?
- YOLOv5 training data prompts No labels found, with_suffix is used, WARNING: Ignoring corrupted image and/or label appears during yolov5 training
- 五、函数的调用过程
- 【OpenCV】 书本视图矫正 + 广告屏幕切换 透视变换图像处理
- 使用 %Status 值
- Golang 字典 map
- An introduction to the width tool, deformation tool and lasso tool
- [Blue Bridge Cup Trial Question 48] Scratch Dance Machine Game Children's Programming Scratch Blue Bridge Cup Trial Question Explanation
猜你喜欢
【OpenCV】 级联分类器训练模型
【R】用grafify搞定统计绘图、方差分析、干预比较等!
An animation basic element movie clip effect
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
GameFi industry down but not out | June Report
[微服务]多级缓存
setTimeout, setInterval requestAnimationFrame
Notepad++ install jsonview plugin
云计算服务主要安全风险及应对措施初探
【蓝桥杯选拔赛真题48】Scratch跳舞机游戏 少儿编程scratch蓝桥杯选拔赛真题讲解
随机推荐
setTimeout 、setInterval、requestAnimationFrame
【R】用grafify搞定统计绘图、方差分析、干预比较等!
Golang GMP 原理
图像融合SDDGAN文章学习
Five, the function calls
leetcode16最接近的三数之和 (排序+ 双指针)
Notepad++ 安装jsonview插件
An基本工具介绍之选择线条工具(包教会)
Sogou news - dataset
An introduction to the pen tool, pencil tool and brush tool
How to build an overseas purchasing system/purchasing website - source code analysis
类和对象(中上)
如何让history历史记录前带时间戳
Free Internet fax platform fax _ don't show number
Byte's favorite puzzle questions, how many do you know?
为冲销量下探中低端市场,蔚来新品牌产品定价低至10万?
Golang 结构体&方法
An animation optimization of traditional guide layer animation
云计算服务主要安全风险及应对措施初探
【深度学习】高效轻量级语义分割综述