华为MPLS-VPN配置练习

  • 一、拓扑以及需求
  • 二、配置思路
    • (1)模拟运营商ISP网络
      • 1、底层OSPF1
      • 2、R5-R6起BGP邻居
      • 3、全网段配置MPLS
    • (2)A公司配置MPLS-VPN
      • 1、起VRF空间
      • 2、在VRF空间中起协议
      • 3、测试连通性
      • 4、路由引入
      • 5、测试连通性
    • (3)B公司配置隧道
      • 1、配置GRE隧道
      • 2、起协议
      • 3、连通性测试
    • (4)两种技术对比
  • 三、本拓扑所有路由器的完整配置
    • R5
    • R6
    • ISP
    • R1
    • R2
    • R3
    • R4

一、拓扑以及需求

  因业务需求,AB两公司需要开设分公司,拉专线太贵,做个VPN吧,两公司最后决定:
  A公司做MPLS-VPN;B公司做隧道。

二、配置思路

(1)模拟运营商ISP网络

1、底层OSPF1

  这里以ISP配置为例,具体配置如下:

ISP配置如下:[isp]ospf 1 router-id 100.100.100.100
[isp-ospf-1]area 0
[isp-ospf-1-area-0.0.0.0]network 100.100.100.100 0.0.0.0
[isp-ospf-1-area-0.0.0.0]network 100.200.50.1 0.0.0.0
[isp-ospf-1-area-0.0.0.0]network 100.200.60.1 0.0.0.0

  OSPF邻居表如下所示:

2、R5-R6起BGP邻居

  这里以R5配置为例,具体配置如下:

R5具体配置如下:
[r5]bgp 1
[r5-bgp]peer 6.6.6.6 as-number 1
[r5-bgp]peer 6.6.6.6 connect-interface LoopBack 0
[r5-bgp]peer 6.6.6.6 next-hop-local# 开启VPNV4路由
[r5-bgp]ipv4-family vpnv4
[r5-bgp-af-vpnv4]peer 6.6.6.6 enable 

  BGP-VPNV4邻居表如下所示:

3、全网段配置MPLS

  这里以R5配置为例,具体配置如下:

R5的MPLS-LDP(LSP隧道)开启配置如下:#全局开启:
[isp]mpls lsr-id 5.5.5.5
[isp]mpls
Info: Mpls starting, please wait... OK!
[isp-mpls]mpls ldp
[r5-mpls-ldp]q#接口开启
[isp]interface GigabitEthernet 0/0/0
[isp-GigabitEthernet0/0/0]mpls
[isp-GigabitEthernet0/0/0]mpls ldp [isp]interface GigabitEthernet 0/0/1
[isp-GigabitEthernet0/0/1]mpls
[isp-GigabitEthernet0/0/1]mpls ldp

  MPLS-LDP邻居表如下所示:

(2)A公司配置MPLS-VPN

  这里以R5配置为例,具体配置如下:

1、起VRF空间

R5的MPLS-VPN配置如下:#创建VRF空间:名称为a1#RD(route-distinguisher):1:1#RT(vpn-targe):1:1
[r5]ip vpn-instance a1
[r5-vpn-instance-a1]route-distinguisher 1:1
[r5-vpn-instance-a1-af-ipv4]vpn-target 1:1IVT Assignment result:
Info: VPN-Target assignment is successful.EVT Assignment result:
Info: VPN-Target assignment is successful.
[r5-vpn-instance-a1-af-ipv4]quit
[r5-vpn-instance-a1]quit #接口绑定VRF空间,通俗可理解为将此接口关在小黑屋内#注意:需要先绑定后配置IP地址,先关后配!
[r5]interface GigabitEthernet 0/0/0
[r5-GigabitEthernet0/0/0]ip binding vpn-instance a1
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[r5-GigabitEthernet0/0/0]ip address 10.200.15.2 24

2、在VRF空间中起协议

  在VRF空间中起不同进程的OSPF协议,以R5为例:

R5起OSPF2具体配置:
[r5]ospf 2 router-id 5.5.5.5 vpn-instance a1
[r5-ospf-2]area 0
[r5-ospf-2-area-0.0.0.0]network 10.200.15.2 0.0.0.0

  R5的OSPF邻居表如下所示:

3、测试连通性

  R1-R5:

  R5-R1:

  R5pingR1不通原因: 由于VRF空间的存在,R5中现在存在两张路由表,一张为公共路由表另一张为VRF空间的路由表,在普通ping的情况下会默认查公共路由表,不会查VRF表,所以不通。
  通俗来讲:公共路由表就好比一个别墅,将某一接口关进小黑屋以后它就不在别墅中了,找东西会默认在别墅中找,因此想找小黑屋中的东西时因指明小黑屋咋走,例如:“-vpn-instance a1”。

4、路由引入

  在BGP和OSPF中做双向重发布,配置如下:

# BGP在ipv4-family重发布
[r5]bgp 1
[r5-bgp]ipv4-family vpn-instance a1
[r5-bgp-a1]import-route ospf 2# OSPF重发布
[r5]ospf 2
[r5-ospf-2]import-route bgp

5、测试连通性

  A分公司-A总公司:

(3)B公司配置隧道

1、配置GRE隧道

  以R6为例,配置如下:

# GRE隧道
[r6]interface Tunnel 0/0/0
[r6-Tunnel0/0/0]ip address 20.200.56.2 24
[r6-Tunnel0/0/0]tunnel-protocol gre
[r6-Tunnel0/0/0]source 100.200.60.2
[r6-Tunnel0/0/0]destination 10.200.50.2[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 20.200.56.1 24
[r5-Tunnel0/0/0]tunnel-protocol gre
[r5-Tunnel0/0/0]source 100.200.50.2
[r5-Tunnel0/0/0]destination 10.200.60.2

2、起协议

  这里我们选择起RIP协议,配置以R3为例:

# R3的RIP协议配置:
[r3]rip 2
[r3-rip-2]version 2
[r3-rip-2]undo summary
[r3-rip-2]network 3.0.0.0
[r3-rip-2]network 20.0.0.0

  注:在OSPF协议中宣告路由时:需要宣告物理接口的路由!!!不是Tunnel口的路由!!

3、连通性测试

  B分公司-B总公司:

(4)两种技术对比

  首先无论是MPLS-VPN还是GRE隧道技术,均可以达到连通异地私网的目的。
  不同在于,MPLS-VPN是利用标签,它是存在于2.5层的技术,在设备的需求上它需要公网区域经过的所有路由器均支持MPLS,对设备要求较高。
  GRE隧道技术是位于3层的技术,它是在逻辑上将异地私网连在一起,在设备需求上仅需要边界连接的设备支持MPLS即可,相比之下对设备要求较低。

三、本拓扑所有路由器的完整配置

R5

[r5]display current-configuration
[V200R003C00]
#sysname r5
#snmp-agent local-engineid 800007DB03000000000000snmp-agent
#clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#drop illegal-mac alarm
#set cpu-usage threshold 80 restore 75
#
ip vpn-instance a1ipv4-familyroute-distinguisher 1:1vpn-target 1:1 export-extcommunityvpn-target 1:1 import-extcommunity
#
mpls lsr-id 5.5.5.5
mpls
#
mpls ldp
#
#
aaa authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain default domain default_admin local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$local-user admin service-type http
#
firewall zone Localpriority 15
#
interface GigabitEthernet0/0/0ip binding vpn-instance a1ip address 10.200.15.2 255.255.255.0
#
interface GigabitEthernet0/0/1ip address 20.200.35.2 255.255.255.0
#
interface GigabitEthernet0/0/2ip address 100.200.50.2 255.255.255.0 mplsmpls ldp
#
interface NULL0
#
interface LoopBack0ip address 5.5.5.5 255.255.255.255
#
interface Tunnel0/0/0ip address 20.200.56.1 255.255.255.0 tunnel-protocol gresource 100.200.50.2destination 100.200.60.2
#
bgp 1peer 6.6.6.6 as-number 1 peer 6.6.6.6 connect-interface LoopBack0#ipv4-family unicastundo synchronizationpeer 6.6.6.6 enablepeer 6.6.6.6 next-hop-local # ipv4-family vpnv4policy vpn-targetpeer 6.6.6.6 enable#ipv4-family vpn-instance a1 import-route ospf 2
#
ospf 1 router-id 5.5.5.5 area 0.0.0.0 network 5.5.5.5 0.0.0.0 network 100.200.50.2 0.0.0.0
#
ospf 2 router-id 5.5.5.5 vpn-instance a1import-route bgparea 0.0.0.0 network 10.200.15.2 0.0.0.0
#
rip 2undo summaryversion 2network 20.0.0.0network 100.0.0.0
#
user-interface con 0authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

R6

[r6]display current-configuration
[V200R003C00]
#sysname r6
#snmp-agent local-engineid 800007DB03000000000000snmp-agent
#clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#drop illegal-mac alarm
#set cpu-usage threshold 80 restore 75
#
ip vpn-instance a1ipv4-familyroute-distinguisher 1:1vpn-target 1:1 export-extcommunityvpn-target 1:1 import-extcommunity
#
mpls lsr-id 6.6.6.6
mpls
#
mpls ldp
#
#
aaa authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain default domain default_admin local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$local-user admin service-type http
#
firewall zone Localpriority 15
#
interface GigabitEthernet0/0/0ip binding vpn-instance a1ip address 10.200.26.2 255.255.255.0
#
interface GigabitEthernet0/0/1ip address 20.200.46.2 255.255.255.0
#
interface GigabitEthernet0/0/2ip address 100.200.60.2 255.255.255.0 mplsmpls ldp
#
interface NULL0
#
interface LoopBack0ip address 6.6.6.6 255.255.255.255
#
interface Tunnel0/0/0ip address 20.200.56.2 255.255.255.0 tunnel-protocol gresource 100.200.60.2destination 100.200.50.2
#
bgp 1peer 5.5.5.5 as-number 1 peer 5.5.5.5 connect-interface LoopBack0#ipv4-family unicastundo synchronizationpeer 5.5.5.5 enablepeer 5.5.5.5 next-hop-local # ipv4-family vpnv4policy vpn-targetpeer 5.5.5.5 enable#ipv4-family vpn-instance a1 import-route ospf 2
#
ospf 1 router-id 6.6.6.6 area 0.0.0.0 network 6.6.6.6 0.0.0.0 network 100.200.60.2 0.0.0.0
#
ospf 2 router-id 6.6.6.6 vpn-instance a1import-route bgparea 0.0.0.0 network 10.200.26.2 0.0.0.0
#
rip 2undo summaryversion 2network 20.0.0.0network 100.0.0.0
#
user-interface con 0authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

ISP

[isp]display current-configuration
[V200R003C00]
#sysname isp
#snmp-agent local-engineid 800007DB03000000000000snmp-agent
#clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#drop illegal-mac alarm
#set cpu-usage threshold 80 restore 75
#
mpls lsr-id 100.100.100.100
mpls
#
mpls ldp
#
#
aaa authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain default domain default_admin local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$local-user admin service-type http
#
firewall zone Localpriority 15
#
interface GigabitEthernet0/0/0ip address 100.200.50.1 255.255.255.0 mplsmpls ldp
#
interface GigabitEthernet0/0/1ip address 100.200.60.1 255.255.255.0 mplsmpls ldp
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0ip address 100.100.100.100 255.255.255.255
#
ospf 1 router-id 100.100.100.100 area 0.0.0.0 network 100.100.100.100 0.0.0.0 network 100.200.50.1 0.0.0.0 network 100.200.60.1 0.0.0.0
#
user-interface con 0authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

R1

[r1]display current-configuration
[V200R003C00]
#sysname r1
#snmp-agent local-engineid 800007DB03000000000000snmp-agent
#clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#drop illegal-mac alarm
#set cpu-usage threshold 80 restore 75
#
aaa authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain default domain default_admin local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$local-user admin service-type http
#
firewall zone Localpriority 15
#
interface GigabitEthernet0/0/0ip address 10.200.15.1 255.255.255.0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0ip address 1.1.1.1 255.255.255.255
#
ospf 2 router-id 1.1.1.1 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 10.200.15.1 0.0.0.0
#
user-interface con 0authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

R2

[r2]display current-configuration
[V200R003C00]
#sysname r2
#snmp-agent local-engineid 800007DB03000000000000snmp-agent
#clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#drop illegal-mac alarm
#set cpu-usage threshold 80 restore 75
#
aaa authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain default domain default_admin local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$local-user admin service-type http
#
firewall zone Localpriority 15
#
interface GigabitEthernet0/0/0ip address 10.200.26.1 255.255.255.0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0ip address 2.2.2.2 255.255.255.255
#
ospf 2 router-id 2.2.2.2 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 10.200.26.1 0.0.0.0
#
user-interface con 0authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

R3

[r3]display current-configuration
[V200R003C00]
#sysname r3
#snmp-agent local-engineid 800007DB03000000000000snmp-agent
#clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#drop illegal-mac alarm
#set cpu-usage threshold 80 restore 75
#
aaa authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain default domain default_admin local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$local-user admin service-type http
#
firewall zone Localpriority 15
#
interface GigabitEthernet0/0/0ip address 20.200.35.1 255.255.255.0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0ip address 3.3.3.3 255.255.255.255
#
rip 2undo summaryversion 2network 3.0.0.0network 20.0.0.0
#
user-interface con 0authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

R4

[r4]display current-configuration
[V200R003C00]
#sysname r4
#snmp-agent local-engineid 800007DB03000000000000snmp-agent
#clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#drop illegal-mac alarm
#set cpu-usage threshold 80 restore 75
#
aaa authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain default domain default_admin local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$local-user admin service-type http
#
firewall zone Localpriority 15
#
interface GigabitEthernet0/0/0ip address 20.200.46.1 255.255.255.0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0ip address 4.4.4.4 255.255.255.255
#
rip 2undo summaryversion 2network 4.0.0.0network 20.0.0.0
#
user-interface con 0authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

华为MPLSVPN与GRE隧道配置练习相关推荐

  1. 内部办公网与IDC机房的GRE隧道配置实践

    背景 公司内网与机房服务器为了实现用内网IP通信的功能,故使用了linux的IP gre隧道的方式.使得公司内部可以直接通过路由直连的方式访问机房服务器. 拓扑图如下: 注:拓扑中的外网IP为虚构的I ...

  2. GRE 隧道配置案例(静态、动态路由)

    把键盘上的H&M扣下来扔了.也算是抵制了吧? GRE VPN 配置案例 要求 拓扑 配置 基础配置 GRE VPN配置 配置路由 验证 Keeplive GRE VPN GRE核心功能:建立隧 ...

  3. GRE隧道配置实验(OSPF)

    实验目的: 配置GRE隧道,并在隧道上运行OSPF动态路由实现互通 组网需求: 如图,R1.R2.R3属于VPN骨干网,它们之间运行OSPF.R2和R3之间使用三层隧道协议GRE,实现PC1和PC2互 ...

  4. GRE隧道配置实验(静态路由)

    实验目的: 配置GRE隧道,并在隧道上运行静态路由实现互通 组网需求: 如图,R1.R2.R3属于VPN骨干网,它们之间运行OSPF.R2和R3之间使用三层隧道协议GRE,实现PC1和PC2互联.PC ...

  5. 一对多GRE隧道配置

    使用如下的配置拓扑: |----------------| |----------------|| | ens33 ens33 | || Client1 |---------------------- ...

  6. 思科、华为 GRE 隧道技术 的原理及配置详解

    文章目录 概述 隧道传递数据包的过程分为3步: GRE 隧道 配置思路 工作原理 实验 实验要求: GRE 配置 总结 华为GRE 配置 概述 GRE是一种最传统的隧道协议,其根本功能就是要实现隧道功 ...

  7. GRE over IPSec 隧道配置案例

    我也想要一个美女老师教我学习网络. GRE over IPSec 配置案例 要求 拓扑 配置 基础配置 GRE VPN配置 配置路由 IPSec配置 GRE over IPSec 技术背景 工作流程 ...

  8. IPSec隧道配置案例(手动模式)

    IPSec有点难需要掌握他的逻辑及框架然后就简单了 网络攻城狮眼里的烟花! IPSec VPN 配置案例 要求 拓扑 配置 基础配置 IPSec VPN配置 分析原因 解决方法 IPSec VPN I ...

  9. 防火墙——GRE隧道讲解

    目录 基本概念 简介 特点 核心功能 GRE封装 VPN封装三要素 乘客协议 封装协议 运输协议 GRE头部报文 注意事项 使用动态路由建立隧道问题 VPN隧道口虚假状态的问题 基本概念 简介 GRE ...

最新文章

  1. V2V-PoseNet算法和应用详解(3D关节点估计领域)
  2. Tensorflow分批量读取tfrecords
  3. 双指针 - 长按键入
  4. 使用VirtualEnvWrapper隔离python项目的库依赖
  5. 认识JSON绑定:概述系列
  6. Qt工作笔记-QCustomPlot的基本使用
  7. hibernate5.0映射配置文件核心配置文件数据更新丢失
  8. oracle性能优化 pdf,Oracle性能优化技术内幕 pdg-pdf
  9. Ringbuffer同步问题分析
  10. 计算机英语念法,电脑的英文读音标准带音标的
  11. 多选题如何做结构方程模型分析?
  12. 【转载】提问的智慧(How To Ask Questions The Smart Way)
  13. Excel:妙用自定义函数让班级名称自动化(转)
  14. Sci-Hub创始人收到苹果的通知:2年前就把她的账户数据给了FBI
  15. 【渝粤题库】国家开放大学2021春2776兽医基础题目
  16. 【原创】PHP程序员的技术成长规划
  17. DirectShow开发点滴
  18. 行路难 李白
  19. [leetcode 面试题 17.17] -- 多次搜索,KMP与字典树
  20. 以TM32最小系统核心板(STM32F103C8T6)为主,实现led流水灯

热门文章

  1. Apache 代理(Proxy) 转发请求
  2. VSCode集成Git
  3. ApacheDS安装 [ LDAP和Kerberos ] 配置
  4. 她是真正的科学女皇!
  5. 开放式地图制图课程——OGC学习秘籍
  6. 计算机休眠usb充电,笔记本电脑在睡眠模式或盖子关闭时如何继续从USB端口充电设备 | MOS86...
  7. python古诗词风格分析_2017年高考古诗词鉴赏技巧:分析语言风格题解题模式
  8. 常见的算法思想(整理)
  9. keyshot渲染玻璃打光_全面解析KeyShot灯光设置教程,如何调节灯光技巧大全
  10. Wine + QQ 轻聊版 7.7 的安装步骤