MPLS 虚拟专用网 实验配置和抓包

MPLS 虚拟专用网 实验配置和抓包

MPLS VPN实验配置和抓包

实验需求:

R1,R3为IBGP关系;R2不配BGP。(MPLS)
R6可以与R4相通;R7可以与R5相通。

实验拓扑图:

在这里插入图片描述

配置思路:

1.配置公网地址
2.公网启用ospf
3.配置MPLS域
4.配置 配置PE与PE间MP-BPG邻居关系
5.配置用户网络
6.配置MPLS VPN
7.将BGP和OSPF进行双向重发布

配置公网地址、公网启用ospf,配置MPLS域

R1上配置:


#
interface GigabitEthernet0/0/2
 ip address 10.1.12.1 255.255.255.0 
 mpls
 mpls ldp
#
interface NULL0
#
interface LoopBack0
 ip address 10.1.1.1 255.255.255.0 
#
#
ospf 1 router-id 1.1.1.1 
 area 0.0.0.0 
  network 10.1.1.1 0.0.0.0 
  network 10.1.12.0 0.0.0.255 
#
mpls lsr-id 10.1.1.1
mpls
#
mpls ldp
#

R2配置


#
interface GigabitEthernet0/0/0
 ip address 10.1.12.2 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.1.23.1 255.255.255.0 
 mpls
 mpls ldp
#

interface LoopBack0
 ip address 10.2.2.2 255.255.255.0 
#
ospf 1 router-id 2.2.2.2 
 area 0.0.0.0 
  network 10.1.12.0 0.0.0.255 
  network 10.1.23.0 0.0.0.255 
  network 10.2.2.2 0.0.0.0 
#
#
mpls lsr-id 10.2.2.2
mpls
#
mpls ldp
#

R3配置与R1配置类似

配置PE与PE间MP-BPG邻居关系(MG-BGP用于传递RT值)

R1配置:

#
bgp 1
 router-id 1.1.1.1
 peer 10.3.3.3 as-number 1 
 peer 10.3.3.3 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 10.3.3.3 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 10.3.3.3 enable
  peer 10.3.3.3 advertise-community
 #

R3与R1类似

配置MPLS VPN

用户端正常启用OSPF进程
PE端使用VRF技术
R1配置:

#
ip vpn-instance a
 ipv4-family
  route-distinguisher 1:1
  vpn-target 100:1 export-extcommunity
  vpn-target 100:1 import-extcommunity
#
ip vpn-instance b
 ipv4-family
  route-distinguisher 2:2
  vpn-target 200:2 export-extcommunity
  vpn-target 200:2 import-extcommunity
#
#
interface GigabitEthernet0/0/0
 ip binding vpn-instance a
 ip address 10.1.14.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance b
 ip address 10.1.15.2 255.255.255.0 
#
#
ospf 2 router-id 1.1.1.1 vpn-instance a
 import-route bgp
 area 0.0.0.0 
  network 10.1.14.0 0.0.0.255 
#
ospf 3 router-id 1.1.1.1 vpn-instance b
 import-route bgp
 area 0.0.0.0 
  network 10.1.15.0 0.0.0.255 
#

将BGP和OSPF进行双向重发布

R1配置:

#
 ipv4-family vpn-instance a 
  import-route ospf 2
 #
 ipv4-family vpn-instance b 
  import-route ospf 3
#
#
ospf 2 router-id 1.1.1.1 vpn-instance a
 import-route bgp

#
ospf 3 router-id 1.1.1.1 vpn-instance b
 import-route bgp

测试:
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
附:
R1全部配置:

<R1>dis current-configuration 
[V200R003C00]
#
 sysname R1
#
 snmp-agent local-engineid 800007DB03000000000000
 snmp-agent 
#
 clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load flash:/portalpage.zip
#
 drop illegal-mac alarm
#
 wlan ac-global carrier id other ac id 0
#
 set cpu-usage threshold 80 restore 75
#
ip vpn-instance a
 ipv4-family
  route-distinguisher 1:1
  vpn-target 100:1 export-extcommunity
  vpn-target 100:1 import-extcommunity
#
ip vpn-instance b
 ipv4-family
  route-distinguisher 2:2
  vpn-target 200:2 export-extcommunity
  vpn-target 200:2 import-extcommunity
#
mpls lsr-id 10.1.1.1
mpls
#
mpls ldp
#
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip binding vpn-instance a
 ip address 10.1.14.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance b
 ip address 10.1.15.2 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 10.1.12.1 255.255.255.0 
 mpls
 mpls ldp
#
interface NULL0
#
interface LoopBack0
 ip address 10.1.1.1 255.255.255.0 
#
bgp 1
 router-id 1.1.1.1
 peer 10.3.3.3 as-number 1 
 peer 10.3.3.3 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 10.3.3.3 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 10.3.3.3 enable
  peer 10.3.3.3 advertise-community
 #
 ipv4-family vpn-instance a 
  import-route ospf 2
 #
 ipv4-family vpn-instance b 
  import-route ospf 3
#
ospf 1 router-id 1.1.1.1 
 area 0.0.0.0 
  network 10.1.1.1 0.0.0.0 
  network 10.1.12.0 0.0.0.255 
#
ospf 2 router-id 1.1.1.1 vpn-instance a
 import-route bgp
 area 0.0.0.0 
  network 10.1.14.0 0.0.0.255 
#
ospf 3 router-id 1.1.1.1 vpn-instance b
 import-route bgp
 area 0.0.0.0 
  network 10.1.15.0 0.0.0.255 
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

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

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


相关推荐

  • 浅谈贝叶斯和MCMC

    浅谈贝叶斯和MCMC 转自:http://www.xuyankun.cn/2017/05/13/bayes/ Abstract:最近课业内的任务不是很多,又邻近暑假了,就在网上搜了一些有关于机器学习和深度学习的课程进行学习。网上的资料非常繁多,很难甄别,我也是货比三家进行学习。这是这个系列的第一个笔记,是关于贝叶斯和MCMC一些数学原理的讲解和代码的实现,希望能够深入浅出,叙述的容易让人理解。…(阅…

    2022年5月5日
    34
  • 《老漏洞复现与分析篇》 – 其一 – shift后门

    《老漏洞复现与分析篇》 – 其一 – shift后门引言因为本菜鸡的博客没什么文章素材,所以想开一个新文章类别,本来想整一个漏洞分析和复现的,无奈由于实力不允许,只能再前面加一个“老”字,整一点多年前的老漏洞拿来复现和分析。俗话说得好,要善于总结前人的经验和智慧,才能在自己的前进道路上走得更快。本系列在我能理解的范围内我都会详细讲解,我不能理解的就靠收集网上的资料了,引用会注明来源和作者,如有侵权请联系我删除。那么废话…

    2022年9月16日
    0
  • springCloud学习笔记-no.2-eruka server和client

    springCloud学习笔记-no.2-eruka server和client1.转载于:https://www.cnblogs.com/andydlz/p/10283293.html

    2022年8月21日
    4
  • Dedecms_DedeCMS提示信息

    Dedecms_DedeCMS提示信息dedecms:说这个是国内人气最旺的cms,我想没有人反对吧?中国站长站(chinaz.com),站长资讯(admin5.com),称这两个站点是大站,没人反对吧?如果你做的是个人站点,如果数据不是很大,那么dedecms依然是首选,dedecms在20w数据就会反应迟钝,有过技术文章分析的,dedecms的数据表频繁查询,导致性能不过关,但是首选你的站有多大?10w篇文章,每天发10篇那…

    2022年9月30日
    0
  • 什么是跨域?跨域解决方法

    什么是跨域?跨域解决方法一、为什么会出现跨域问题出于浏览器的同源策略限制。同源策略(Sameoriginpolicy)是一种约定,它是浏览器最核心也最基本的安全功能,如果缺少了同源策略,则浏览器的正常功能可能都会受到影响。可以说Web是构建在同源策略基础之上的,浏览器只是针对同源策略的一种实现。同源策略会阻止一个域的javascript脚本和另外一个域的内容进行交互。所谓同源(即指在同一个域)就是两个页面具有相同的协…

    2022年4月28日
    51
  • 3月份感觉比较漫长,可能因为经历得比较多吧

    3月份感觉比较漫长,可能因为经历得比较多吧

    2020年11月12日
    232

发表回复

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

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