MPLS 虚拟专用网络 Hub and Spoke实验

MPLS 虚拟专用网络 Hub and Spoke实验

MPLS VPN Hub and Spoke实验

实验拓扑

在这里插入图片描述

实验要求

1.R6与R7通信需要经过R1,不可以直通
2.HUB-CE,SPOKE-CE在同一个AS(allow
-as-loop的合理使用)
3.各个PE与CE之间均为EBGP关系(也可以做IBGP,OSPF)

配置

1.R2,3,4,5配置路由,并启用ospf

2.PE之间配置MP-BGP邻居关系

(减少IBGP邻居的建立使用 RR 反射器,其中R2充当反射器最为合适)

3.R2,3,4,5启用MPLS

3.SPOKE-PE配置VPN实例,并进入接口进行绑定

4.HUB-PE上配置只进的VPN实例,和只出的VPN实例

5.配置PE与CE间路由交换(允许路由环路)

测试:

R2上dis bgp vpnv4 vpn-instance in routing-table
在这里插入图片描述
R2上dis bgp vpnv4 vpn-instance out routing-table

在这里插入图片描述
R6pingR7
在这里插入图片描述

全部配置:

R1

#
 sysname R1
#
interface GigabitEthernet0/0/0
 ip address 10.1.12.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.2.12.1 255.255.255.0 
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 10.1.1.1 255.255.255.0 
#
bgp 10
 peer 10.1.12.2 as-number 100 
 peer 10.2.12.2 as-number 100 
 #
 ipv4-family unicast
  undo synchronization
  network 10.1.1.0 255.255.255.0 
  peer 10.1.12.2 enable
  peer 10.1.12.2 allow-as-loop
  peer 10.2.12.2 enable
  peer 10.2.12.2 allow-as-loop
#

R2

#
 sysname R2
#
ip vpn-instance in
 ipv4-family
  route-distinguisher 2:2
  vpn-target 1:1 1:2 import-extcommunity
#
ip vpn-instance out
 ipv4-family
  route-distinguisher 2:1
  vpn-target 2:1 export-extcommunity
#
mpls lsr-id 10.2.2.2
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip binding vpn-instance in
 ip address 10.1.12.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance out
 ip address 10.2.12.2 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 10.1.23.1 255.255.255.0 
 mpls
 mpls ldp
#
interface NULL0
#
interface LoopBack0
 ip address 10.2.2.2 255.255.255.0 
#
bgp 100
 peer 10.4.4.4 as-number 100 
 peer 10.4.4.4 connect-interface LoopBack0
 peer 10.5.5.5 as-number 100 
 peer 10.5.5.5 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 10.4.4.4 enable
  peer 10.4.4.4 reflect-client
  peer 10.4.4.4 next-hop-local 
  peer 10.5.5.5 enable
  peer 10.5.5.5 reflect-client
  peer 10.5.5.5 next-hop-local 
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 10.4.4.4 enable
  peer 10.4.4.4 reflect-client
  peer 10.5.5.5 enable
  peer 10.5.5.5 reflect-client
 #
 ipv4-family vpn-instance in 
  peer 10.1.12.1 as-number 10 
 #
 ipv4-family vpn-instance out 
  peer 10.2.12.1 as-number 10 
  peer 10.2.12.1 allow-as-loop 2
#
ospf 1 router-id 2.2.2.2 
 area 0.0.0.0 
  network 10.1.23.0 0.0.0.255 
  network 10.2.2.2 0.0.0.0 
#

R3

#
 sysname R3
#
mpls lsr-id 10.3.3.3
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.1.23.2 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.1.34.2 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/2
 ip address 10.1.35.2 255.255.255.0 
 mpls
 mpls ldp
#
interface NULL0
#
interface LoopBack0
 ip address 10.3.3.3 255.255.255.0 
#
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 10.1.23.0 0.0.0.255 
  network 10.1.34.0 0.0.0.255 
  network 10.1.35.0 0.0.0.255 
  network 10.3.3.3 0.0.0.0 
#

R4

#
 sysname R4
#
ip vpn-instance spoke
 ipv4-family
  route-distinguisher 1:1
  vpn-target 1:1 export-extcommunity
  vpn-target 2:1 import-extcommunity
#
mpls lsr-id 10.4.4.4
mpls
#
mpls ldp
#

interface GigabitEthernet0/0/0
 ip address 10.1.34.1 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance spoke
 ip address 10.1.46.2 255.255.255.0 
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 10.4.4.4 255.255.255.0 
#
bgp 100
 peer 10.2.2.2 as-number 100 
 peer 10.2.2.2 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 10.2.2.2 enable
  peer 10.2.2.2 next-hop-local 
  peer 10.2.2.2 allow-as-loop
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 10.2.2.2 enable
 #
 ipv4-family vpn-instance spoke 
  peer 10.1.46.1 as-number 10 
  peer 10.1.46.1 allow-as-loop
#
ospf 1 router-id 4.4.4.4 
 area 0.0.0.0 
  network 10.1.34.0 0.0.0.255 
  network 10.4.4.4 0.0.0.0 
#

R5

#
 sysname R5
#
ip vpn-instance spoke
 ipv4-family
  route-distinguisher 1:2
  vpn-target 1:2 export-extcommunity
  vpn-target 2:1 import-extcommunity
#
mpls lsr-id 10.5.5.5
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.1.35.1 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance spoke
 ip address 10.1.57.2 255.255.255.0 
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 10.5.5.5 255.255.255.0 
#
bgp 100
 peer 10.2.2.2 as-number 100 
 peer 10.2.2.2 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 10.2.2.2 enable
  peer 10.2.2.2 next-hop-local 
  peer 10.2.2.2 allow-as-loop
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 10.2.2.2 enable
 #
 ipv4-family vpn-instance spoke 
  peer 10.1.57.1 as-number 10 
  peer 10.1.57.1 allow-as-loop
#
ospf 1 router-id 5.5.5.5 
 area 0.0.0.0 
  network 10.1.35.0 0.0.0.255 
  network 10.5.5.5 0.0.0.0 
#

R6

#
 sysname R6
#
interface GigabitEthernet0/0/0
 ip address 10.1.46.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 10.6.6.6 255.255.255.0 
#
bgp 10
 peer 10.1.46.2 as-number 100 
 #
 ipv4-family unicast
  undo synchronization
  network 10.6.6.0 255.255.255.0 
  peer 10.1.46.2 enable
  peer 10.1.46.2 allow-as-loop 2
 # 
 ipv4-family vpnv4
  policy vpn-target
#

R7

#
 sysname R7
#
interface GigabitEthernet0/0/0
 ip address 10.1.57.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 10.7.7.7 255.255.255.0 
#
bgp 10
 peer 10.1.57.2 as-number 100 
 #
 ipv4-family unicast
  undo synchronization
  network 10.7.7.0 255.255.255.0 
  peer 10.1.57.2 enable
  peer 10.1.57.2 allow-as-loop 2
#
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/100140.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 请编写一个给list去重的函数_计算表达式

    请编写一个给list去重的函数_计算表达式c#拉姆达表达式实现List去重varlist=studentlist.OrderByDescending(a=>a.CreateDate).ToList();Console.WriteLine(JsonConvert.SerializeObject(list.Where((x,i)=>list.FindIndex(z=&gt…

    2025年12月6日
    3
  • 华为数通hcie_通融理赔后需要签协议吗

    华为数通hcie_通融理赔后需要签协议吗Internet组管理协议称为IGMP协议(InternetGroupManagementProtocol),是因特网协议家族中的一个组播协议。该协议运行在主机和组播路由器之间。IGMP包含了IGMPv1、IGMPv2、IGMPv3三个版本,目前正处于由IGMPv2向IGMPv3的过渡阶段。本篇将按照IGMP基本原理、IGMP三个版本、IGMPSnooping几部分对IGMP协议进行介绍。

    2025年11月16日
    2
  • pytest的assert_assert断言语句

    pytest的assert_assert断言语句前言断言是写自动化测试基本最重要的一步,一个用例没有断言,就失去了自动化测试的意义了。什么是断言呢?简单来讲就是实际结果和期望结果去对比,符合预期那就测试pass,不符合预期那就测试failed

    2022年7月28日
    19
  • ZOJ 2412 Farm Irrigation(DFS 条件通讯块)

    ZOJ 2412 Farm Irrigation(DFS 条件通讯块)

    2022年1月5日
    60
  • Typora设置图片存储路径「建议收藏」

    Typora设置图片存储路径「建议收藏」Typora设置图片存储路径Typora设置图片存储路径Typora设置图片存储路径最近经常在用Typora编写文档,每次剪切的图都是默认保存在C盘中Typora默认的保存图片的文件夹中,每次找起来不是很方便,所有最近想设置下剪切图片保存的位置。因为这东西不常用,想想还是记录下来点击文件,选择偏好设置原来是无特殊操作,个人还是倾向于选择图中选项选择此选项后会,在md文档所在文件夹中…

    2022年7月12日
    19
  • Maven配置及IDEA中配置Maven详解

    Maven配置及IDEA中配置Maven详解1、Maven安装配置首先到官网下载http://maven.apache.org/download.cgi 我们需要下载的bin.zip结尾的文件,下载后解压到指定文件夹(全英文路径) 配置环境变量确保JAVA环境变量已经配置好了。添加M2_HOME和MAVEN_HOME环境变量到Windows环境变量。 PATH变量添加%M2_HOME%\bin修…

    2022年5月11日
    83

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号