当前位置:网站首页>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 四、测试
终上所述:该实验的所有要求已经达成 ,实验成功。
边栏推荐
猜你喜欢

An introduction to 3D tools

【蓝桥杯选拔赛真题48】Scratch跳舞机游戏 少儿编程scratch蓝桥杯选拔赛真题讲解

An动画基础之元件的图形动画与按钮动画

Station B responded that "HR said that core users are all Loser": the interviewer was persuaded to quit at the end of last year and will learn lessons to strengthen management

shell编程之条件语句

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

ECCV 2022|通往数据高效的Transformer目标检测器

海外代购系统/代购网站怎么搭建——源码解析

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毕业设计)
随机推荐
便携烙铁开源系统IronOS,支持多款便携DC, QC, PD供电烙铁,支持所有智能烙铁标准功能
An introduction to the width tool, deformation tool and lasso tool
字节最爱问的智力题,你会几道?
An工具介绍之骨骼工具
五、函数的调用过程
An动画基础之元件的影片剪辑动画与传统补间
Comics: how do you prove that sleep does not release the lock, and wait to release lock?
欧曼自动挡、银河大马力、行星新产品 欧曼全新产品以燎原之势赢领市场
Key points for account opening of futures companies
self-discipline
Yahoo! Answers-数据集
图像融合GAN-FM学习笔记
博客记录生活
Redis连接池工具类
Jmeter使用
The Yangtze river commercial Banks to the interview
setTimeout 、setInterval、requestAnimationFrame
Nodejs 安装依赖cpnm时,install 出现Error: Cannot find module ‘fs/promises‘
期货公司开户关注的关键点
Golang 数组和切片


