目录

一、背景

二、拓扑

三、实现

1.配置IP地址。

2.在ISP域内配置OSPF,启用MPLS。

3.在两个Spoke的PE(R2、R3)上启用VRF关联接口。

4.在两个Spoke的CE(R5、R6)上启用BGP。

5.在两个Spoke的PE(R2、R3)上回指BGP的邻接关系。

6.ISP域内建立Full Mesh的VPNv4的BGP邻接关系。

7.在Hub的PE(R1)上起两个子接口,关联对应的VRF。

8.在Hub的CE(R4)上起两个子接口。

9.在Hub的CE(R4)上和R1建立BGP。

10.在Hub的PE(R1)上和R4建立BGP.

11.测试。


一、背景

两个Spoke通过Hub做中转实现互访。

二、拓扑

三、实现

1.配置IP地址。

R1(config)#int loo 0
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#no shutdown
R1(config-if)#exit R1(config)#int ethernet 0/0
R1(config-if)#ip add 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit R1(config)#int ethernet 0/1
R1(config-if)#ip add 13.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit 
R2(config)#int loo 0
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#no shutdown
R2(config-if)#exitR2(config)#int ethernet 0/1
R2(config-if)#ip add 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit R2(config)#int ethernet 0/0
R2(config-if)#ip add 172.16.25.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit 
R3(config)#int loo 0
R3(config-if)#ip add 3.3.3.3 255.255.255.255
R3(config-if)#no shutdown
R3(config-if)#exit R3(config)#int e0/0
R3(config-if)#ip add 13.1.1.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exitR3(config)#int e0/1
R3(config-if)#ip add 172.16.36.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit 
R4(config)#int loo 0
R4(config-if)#ip add 172.16.4.4 255.255.255.255
R4(config-if)#no shutdown 
R5(config)#int loo 0
R5(config-if)#ip add 172.16.5.5 255.255.255.255
R5(config-if)#no shutdown R5(config)#int e0/0
R5(config-if)#ip add 172.16.25.5 255.255.255.0
R5(config-if)#no shutdown
R5(config-if)#exit 
R6(config)#int loo 0
R6(config-if)#ip add 172.16.6.6 255.255.255.255
R6(config-if)#no shutdown
R6(config-if)#exit R6(config)#int e0/0
R6(config-if)#ip add 172.16.36.6 255.255.255.0
R6(config-if)#no shutdown
R6(config-if)#exit 

2.在ISP域内配置OSPF,启用MPLS。

R1(config)#ip cef
R1(config)#mpls ip
R1(config)#mpls label protocol ldp
R1(config)#mpls ldp router-id loopback 0 force R1(config)#int ran e0/0-1
R1(config-if-range)#mpls ip
R1(config-if-range)#exit R1(config)#router ospf 10
R1(config-router)#router-id 1.1.1.1
R1(config-router)#net 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 12.1.1.2 0.0.0.0 area 0
R1(config-router)#net 13.1.1.1 0.0.0.0 area 0
R1(config-router)#exit
R2(config)#ip cef
R2(config)#mpls ip
R2(config)#mpls label protocol ldp
R2(config)#mpls ldp router-id loopback 0 force R2(config)#int e0/1
R2(config-if)#mpls ip
R2(config-if)#exitR2(config)#router ospf 10
R2(config-router)#router-id 2.2.2.2
R2(config-router)#net 2.2.2.2 0.0.0.0 area 0
R2(config-router)#net 12.1.1.2 0.0.0.0 area 0
R2(config-router)#exit 
R3(config)#ip cef
R3(config)#mpls ip
R3(config)#mpls label protocol ldp
R3(config)#mpls ldp router-id loopback 0 force R3(config)#int e0/0
R3(config-if)#mpls ip
R3(config-if)#exit R3(config)#router ospf 10
R3(config-router)#router-id 3.3.3.3
R3(config-router)#net 3.3.3.3 0.0.0.0 area 0
R3(config-router)#net 13.1.1.3 0.0.0.0 area 0
R3(config-router)#exit 

3.在两个Spoke的PE(R2、R3)上启用VRF关联接口。

R2(config)#vrf definition Spoke1
R2(config-vrf)#rd 5:5
R2(config-vrf)#address-family ipv4
R2(config-vrf-af)#route-target export 5:5
R2(config-vrf-af)#route-target import 100:100
R2(config-vrf-af)#exit
R2(config-vrf)#exit R2(config-if)#int e0/0
R2(config-if)#vrf forwarding Spoke1
R2(config-if)#ip address 172.16.25.2 255.255.255.0
R2(config-if)#exit 
R3(config)#vrf definition Spoke2
R3(config-vrf)#rd 6:6
R3(config-vrf)#address-family ipv4
R3(config-vrf-af)#route-target export 6:6
R3(config-vrf-af)#route-target import 100:100
R3(config-vrf-af)#exit-address-family
R3(config-vrf)#exit R3(config)#int e0/1
R3(config-if)#vrf forwarding Spoke2
R3(config-if)# ip address 172.16.36.3 255.255.255.0
R3(config-if)#exit 

4.在两个Spoke的CE(R5、R6)上启用BGP。

R5(config)#router bgp 5R5(config-router)#bgp router-id 5.5.5.5R5(config-router)#no auto-summary
R5(config-router)#no synchronization
R5(config-router)#no bgp default ipv4-unicast R5(config-router)#neighbor 172.16.25.2 remote-as 10R5(config-router)#address-family ipv4 unicast
R5(config-router-af)#neighbor 172.16.25.2 activate
R5(config-router-af)#redistribute connected R5(config-router-af)#exit-address-family
R5(config-router)#exit
R6(config)#router bgp 6
R6(config-router)#bgp router-id 6.6.6.6R6(config-router)#no auto-summary
R6(config-router)#no synchronization
R6(config-router)#no bgp default ipv4-unicast R6(config-router)#neighbor 172.16.36.3 remote-as 10R6(config-router)#address-family ipv4 unicast
R6(config-router-af)#neighbor 172.16.36.3 activate
R6(config-router-af)#redistribute connected R6(config-router-af)#exit-address-family
R6(config-router)#exit 

5.在两个Spoke的PE(R2、R3)上回指BGP的邻接关系。

R2(config)#router bgp 10
R2(config-router)#bgp router-id 2.2.2.2R2(config-router)#no auto-summary
R2(config-router)#no synchronization
R2(config-router)#no bgp default ipv4R2(config-router)#address-family ipv4 vrf Spoke1
R2(config-router-af)#neighbor 172.16.25.5 remote-as 5 R2(config-router-af)#exit-address-family
R2(config-router)#exi
R2(config-router)#exit 
R3(config)#router bgp 10
R3(config-router)#bgp router-id 3.3.3.3R3(config-router)# no auto-summary
R3(config-router)#no synchronization
R3(config-router)#no bgp default ipv4-unicast R3(config-router)#address-family ipv4 vrf Spoke2
R3(config-router-af)#neighbor 172.16.36.6 remote-as 6
R3(config-router-af)#neighbor 172.16.36.6 activate R3(config-router-af)#exi
R3(config-router)#exit 

6.ISP域内建立Full Mesh的VPNv4的BGP邻接关系。

R2(config)#router bgp 10 R2(config-router)#neighbor 1.1.1.1 remote-as 10
R2(config-router)#neighbor 1.1.1.1 update-source loopback 0R2(config-router)#neighbor 3.3.3.3 remote-as 10
R2(config-router)#neighbor 3.3.3.3 update-source loopback 0R2(config-router)#address-family vpnv4 unicast    R2(config-router-af)#neighbor 1.1.1.1 activate
R2(config-router-af)#neighbor 1.1.1.1 send-community extended R2(config-router-af)#neighbor 3.3.3.3 activate
R2(config-router-af)#neighbor 3.3.3.3 send-community extended R2(config-router-af)#exit-address-family
R2(config-router)#exit 
R3(config)#router bgp 10R3(config-router)#neighbor 1.1.1.1 remote-as 10
R3(config-router)#neighbor 1.1.1.1 update-source loopback 0R3(config-router)#neighbor 2.2.2.2 remote-as 10
R3(config-router)#neighbor 2.2.2.2 update-source loopback 0R3(config-router)#address-family vpnv4 unicast R3(config-router-af)#neighbor 1.1.1.1 activate
R3(config-router-af)#neighbor 1.1.1.1 send-community extended R3(config-router-af)#neighbor 2.2.2.2 activate
R3(config-router-af)#neighbor 2.2.2.2 send-community extended R3(config-router-af)#exit-address-family
R3(config-router)#exit 
R1(config)#router bgp 10
R1(config-router)#bgp router-id 1.1.1.1R1(config-router)#no auto-summary
R1(config-router)#no synchronization
R1(config-router)#no bgp default ipv4-unicast R1(config-router)#neighbor 2.2.2.2 remote-as 10
R1(config-router)#neighbor 2.2.2.2 update-source loopback 0R1(config-router)#neighbor 3.3.3.3 remote-as 10
R1(config-router)#neighbor 3.3.3.3 update-source loopback 0R1(config-router)#address-family vpnv4 unicast   R1(config-router-af)#neighbor 2.2.2.2 activate
R1(config-router-af)#neighbor 2.2.2.2 send-community extended R1(config-router-af)#neighbor 3.3.3.3 activate
R1(config-router-af)#neighbor 3.3.3.3 send-community extended R1(config-router-af)#exit-address-family
R1(config-router)#exit 

7.在Hub的PE(R1)上起两个子接口,关联对应的VRF。

R1(config)#vrf definition Spoke-to-Hub
R1(config-vrf)#rd 56:56
R1(config-vrf)#address-family ipv4
R1(config-vrf-af)#route-target import 5:5
R1(config-vrf-af)#route-target import 6:6
R1(config-vrf-af)#exit-address-family
R1(config-vrf)#exit R1(config)#vrf definition Hub-to-Spoke
R1(config-vrf)#rd 100:100
R1(config-vrf)#address-family ipv4
R1(config-vrf-af)#route-target export 100:100
R1(config-vrf-af)#exit-address-family
R1(config-vrf)#exit R1(config)#interface ethernet 0/2
R1(config-if)#no shutdown
R1(config-if)#exit R1(config)#int ethernet 0/2.56
R1(config-subif)#vrf forwarding Spoke-to-Hub
R1(config-subif)#encapsulation dot1Q 56
R1(config-subif)#ip address 172.16.56.1 255.255.255.0
R1(config-subif)#no shutdown
R1(config-subif)#exit R1(config)#int ethernet 0/2.100
R1(config-subif)#vrf forwarding Hub-to-Spoke
R1(config-subif)#encapsulation dot1Q 100
R1(config-subif)#ip address 172.16.100.1 255.255.255.0
R1(config-subif)#no shutdown
R1(config-subif)#exit 

8.在Hub的CE(R4)上起两个子接口。

R4(config)#int ethernet 0/0
R4(config-if)#no shutdown
R4(config-if)#exit R4(config)#int ethernet 0/0.56
R4(config-subif)#encapsulation dot1Q 56
R4(config-subif)#ip address 172.16.56.4 255.255.255.0
R4(config-subif)#no shutdown R4(config)#int ethernet 0/0.100
R4(config-subif)#encapsulation dot1Q 100
R4(config-subif)#ip address 172.16.100.4 255.255.255.0
R4(config-subif)#no shutdown
R4(config-subif)#exit  

9.在Hub的CE(R4)上和R1建立BGP。

R4(config)#router bgp 4
R4(config-router)#bgp router-id 4.4.4.4R4(config-router)#no auto-summary
R4(config-router)#no synchronization
R4(config-router)#no bgp default ipv4-unicast R4(config-router)#neighbor 172.16.56.1 remote-as 10
R4(config-router)#neighbor 172.16.100.1 remote-as 10R4(config-router)#address-family ipv4 unicast R4(config-router-af)#neighbor 172.16.56.1 active
R4(config-router-af)#neighbor 172.16.100.1 active
R4(config-router-af)#redistribute connected
R4(config-router-af)#aggregate-address 172.16.0.0 255.255.0.0 summary-only R4(config-router-af)#exit-address-family
R4(config-router)#exit 

10.在Hub的PE(R1)上和R4建立BGP.

R1(config)#router bgp 10R1(config-router)#address-family ipv4 vrf Spoke-to-Hub
R1(config-router-af)#neighbor 172.16.56.4 remote-as 4
R1(config-router-af)#neighbor 172.16.56.4 activate
R1(config-router-af)#exit-address-family R1(config-router)#address-family ipv4 vrf Hub-to-Spoke
R1(config-router-af)#neighbor 172.16.100.4 remote-as 4
R1(config-router-af)#neighbor 172.16.100.4 activate R1(config-router-af)#exit-address-family
R1(config-router)#exit 

11.测试。

①.

R1通过两个VRF都收到了关于172.16.0.0/16的路由,但是通过Spoke-to-Hub这个VRF收到是没有关系的,因为它不能给两个Spoke传,因为在Spoke-to-Hub的这个VRF中没有设置导出RT。这个Spoke-to-Hub的VRF是专门接收Spoke的明细路由的。

②.

R4可以收到两个Spoke的明细路由,并且都是通过172.16.56.1收到的。接下来R4把这些路由汇总之后形成了一条 172.16.0.0/16的汇总路由。

③.

自己把下游的明细发送上去,然后收到了一条汇总路由。

④.

R5,和R6也会通过PE收到这条汇总路由。

⑤.R5和R6基于这条汇总路由可以访问Hub、也可以访问其他Spoke的网络。

报文先发送给R2,R2给报文添加了一个标签19,19是内层标签,外层标签已经通过PHP去掉了;R2再把报文发送给R1,R1收到报文之后,会发现是VPNv4标签,查找对应的路由条目就发送走了。

Cisco(59)——HubSpoke MPLS相关推荐

  1. 所谓移动IP是指(58);实现移动IP的关键技术是(59)。【答案】D B

    所谓移动IP是指(58):实现移动IP的关键技术是(59). (58)A.通过地址翻译技术改变主机的IP地址 B.一个主机的IP地址可以转移给另一个主机 C.移动主机通过在无线通信网中漫游来保持网络连 ...

  2. 『中级篇』阿里云安装Docker企业版UCP和DTR(59)

    原创文章,欢迎转载.转载请注明:转载自IT人故事会,谢谢! 原文链接地址:『中级篇』阿里云安装Docker企业版UCP和DTR(59) 前面一节讲到了如何在阿里云使用容器服务的方式,本节主要讲讲如何在 ...

  3. 运维少年系列 python and cisco (1)

    运维少年系列 python and cisco (1) 预备知识 本系列文章需要各位具有CCNA/HCNA基础知识(知道命令怎么敲) python 本系列文章需要使用到的python版本为2.7,模块 ...

  4. (59)UART外设驱动用户接收模块(四)(第12天)

    (59)UART外设驱动用户接收模块(四)(第12天) 1 文章目录 1)文章目录 2)FPGA初级课程介绍 3)FPGA初级课程架构 4)UART外设驱动用户接收模块(四)(第12天) 5)技术交流 ...

  5. (59)Verilog HDL测试激励:时钟激励1

    (59)Verilog HDL测试激励:时钟激励1 1.1 目录 1)目录 2)FPGA简介 3)Verilog HDL简介 4)Verilog HDL测试激励:时钟激励1 5)结语 1.2 FPGA ...

  6. (59)TCL脚本命令【全局变量】

    (59)TCL脚本命令[全局变量] 1 目录 1.1 TCL简介 1.2 TCL的起源与发展 1.3 TCL语言与库介绍 1.4 TCL运行环境 1.5 TCL脚本命令[全局变量] 1.6 结束语 2 ...

  7. Cisco(思科)远程登录路由器

    Cisco(思科)远程登录路由器 一.拓扑图 二.实验步骤 1.先配置好路由器,配置如下: 先进入配置电脑的终端进行配置操作 Cisco在模拟器中路由器有两个接口interface f0/0 .int ...

  8. 联科教育为全球最大的网络供应商Cisco(思科)提供技术培训!

    联科摘要 联科教育为全球最大的网络供应商Cisco(思科)提供技术培训! 联科教育自9月开始为思科(中国)提供了关于微软技术的培训,课程培训的内容包含Windows Server 2012的安装和配置 ...

  9. cisco(思科)交换机操作(基本查询命令)【一】

    在网络环境错综复杂的今天,交换机已经不可或缺了,所以交换机的厂商也发展很快,这里就拿cisco来给大家简单的交流一下!cisco:思科:简单的介绍一下:思科公司是全球领先的网络解决方案供应商.cisc ...

最新文章

  1. 2021年大数据Spark(二十五):SparkSQL的RDD、DF、DS相关操作
  2. 互联网人才大迁徙:新基建人均月薪17895元,核心人才缺口420万
  3. python如何自定义模块_python自定义模块和开源模块使用方法
  4. spring data redis 使用之 spring boot 2.x
  5. Freebsd10.3(FreeBSD11 Beta1)使用手记
  6. 理解SharePoint中的Managed Path
  7. hexo的yelee主题修改左上角的博客名字颜色、修改代码模块中的引号内部的字体颜色
  8. invalid use of incomplete type struct 或者是class的解决办法
  9. Python连连看小游戏源代码
  10. Hexo+Github博客搭建教程
  11. 【高效生活】如何将csf格式文件转化成其它格式
  12. emoji语言抽象话大全_当抽象话也成为一种暗语
  13. [无忧网络验证]代理使用教程
  14. 安装g++时出现的一种报错及解决方案
  15. linux卸载nginx(更新)
  16. android xml绘图p113-p117
  17. 个人网站设计-Stigma
  18. 【UE4】模仿《黑暗之魂》系列游戏制作一个简单的锁定敌人的功能
  19. 人生七工具:SWOT、PDCA、6W2H、SMART、WBS、时间管理、OKR
  20. 同济、阿里获CVPR最佳学生论文,李飞飞获黄煦涛奖,近6000人线下参会

热门文章

  1. java pdf 预览_pdf.js实现图片在线预览
  2. 城市智能停车系统解决方案介绍
  3. android的m、mm、mmm编译命令的使用
  4. 字节与字符与常见编码方式
  5. 远洋调查设备使用快讯—Sentinel,磁力仪绞车
  6. 虚拟驾驶环境搭建(二)
  7. ARM加速更迭,国产“芯”替代迎来新战机,123BOM编辑器(BOM123编辑器)是硬件工程师整理BOM的好帮手,嵌入式硬件工程师未来可期
  8. 004-云E办项目搭建环境
  9. centos7——Linux系统下如何连接网络图文讲解教程
  10. 人工智能复试面试题总结