MPLS 基础MPLS-VPN 标签分析

R1---(R2---R3---R4)--R5
|__EBGP__|_____IBGP______|__EBGP_|
 12.0/24          23.0/24      34.0/24   45.0/24

R2-R 4是MPLs和MPLS-VPN域

R2和R4上的vrf:
ip vrf vpn1
 rd 100:1
 route-target export 100:1
 route-target import 100:1

r4#sh ip vrf d
VRF vpn1; default RD 100:1; default VPNID
  Interfaces:
    Serial2/0              
  Connected addresses are not in global routing table
  Export VPN route-target communities
    RT:100:1               
  Import VPN route-target communities
    RT:100:1               
  No import route-map
  No export route-map

============================================

两边ce学到的路由如下:

r1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, Serial1/0
     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
O E2 192.168.45.0/24 [110/1] via 192.168.12.2, 00:27:32, Serial1/0
     5.0.0.0/32 is subnetted, 1 subnets
O E2    5.5.5.5 [110/65] via 192.168.12.2, 00:27:32, Serial1/0
O E2 192.168.56.0/24 [110/128] via 192.168.12.2, 00:27:32, Serial1/0

------------------------------------------------------------------------------------------
r5#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

O E2 192.168.12.0/24 [110/1] via 192.168.45.4, 00:28:10, Serial2/0
     1.0.0.0/32 is subnetted, 1 subnets
O E2    1.1.1.1 [110/65] via 192.168.45.4, 00:28:10, Serial2/0
C    192.168.45.0/24 is directly connected, Serial2/0
     5.0.0.0/32 is subnetted, 1 subnets
C       5.5.5.5 is directly connected, Loopback0
C    192.168.56.0/24 is directly connected, Serial1/0

=============================================

R2上的vpnv4路由如下

r2#sh ip b v all
BGP table version is 11, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure
Origin codes: i - IGP, e - EGP, ? - incomplete

Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 100:1 (default for vrf vpn1)
*> 1.1.1.1/32       192.168.12.1            65         32768 ?
*>i5.5.5.5/32       4.4.4.4                 65    100      0 ?
*> 192.168.12.0     0.0.0.0                  0         32768 ?
*>i192.168.45.0     4.4.4.4                  0    100      0 ?
*>i192.168.56.0     4.4.4.4                128    100      0 ?

r2#sh ip rou vrf vpn1
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, Serial1/0
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/65] via 192.168.12.1, 00:21:37, Serial1/0
B    192.168.45.0/24 [200/0] via 4.4.4.4, 00:17:34
     5.0.0.0/32 is subnetted, 1 subnets
B       5.5.5.5 [200/65] via 4.4.4.4, 00:17:34
B    192.168.56.0/24 [200/128] via 4.4.4.4, 00:17:34

r2#show ip cef detail

4.4.4.4/32, version 8, epoch 0, cached adjacency to Serial2/0
0 packets, 0 bytes
  tag information set
    local tag: 201
    fast tag rewrite with Se2/0, point2point, tags imposed: {301}
  via 192.168.23.3, Serial2/0, 3 dependencies
    next hop 192.168.23.3, Serial2/0
    valid cached adjacency
    tag rewrite with Se2/0, point2point, tags imposed: {301}

r2#sh ip cef vrf vpn1 detail

5.5.5.5/32, version 6, epoch 0, cached adjacency to Serial2/0
0 packets, 0 bytes
  tag information set
    local tag: VPN-route-head
    fast tag rewrite with Se2/0, point2point, tags imposed: {301 405}
  via 4.4.4.4, 0 dependencies, recursive
    next hop 192.168.23.3, Serial2/0 via 4.4.4.4/32
    valid cached adjacency
    tag rewrite with Se2/0, point2point, tags imposed: {301 405}

顶层标签是借用global中关于到4.4.4.4这条igp路由的标签

r2#sh ip b vpnv4 all tag
   Network          Next Hop      In tag/Out tag
Route Distinguisher: 100:1 (vpn1)
   1.1.1.1/32       192.168.12.1    205/notag
   5.5.5.5/32       4.4.4.4         notag/405
   192.168.12.0     0.0.0.0         206/aggregate(vpn1)
   192.168.45.0     4.4.4.4         notag/404
   192.168.56.0     4.4.4.4         notag/406

[1] [2] [3] 下一页  

文章录入:csh    责任编辑:csh 

r2#sh tag f
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop   
tag    tag or VC   or Tunnel Id      switched   interface             
200    Pop tag     3.3.3.3/32        0          Se2/0      point2point 
201    301         4.4.4.4/32        0          Se2/0      point2point 
202    Pop tag     192.168.34.0/24   0          Se2/0      point2point 
205    Untagged    1.1.1.1/32[V]     0          Se1/0      point2point 
206    Aggregate   192.168.12.0/24[V]   \
                                     0

r3#sh tag f
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop   
tag    tag or VC   or Tunnel Id      switched   interface             
300    Pop tag     2.2.2.2/32        63         Se2/0      point2point 
301    Pop tag     4.4.4.4/32        107        Se1/0      point2point

次末跳弹出

r4#sh tag f
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop   
tag    tag or VC   or Tunnel Id      switched   interface             
400    300         2.2.2.2/32        0          Se1/0      point2point 
401    Pop tag     3.3.3.3/32        0          Se1/0      point2point 
402    300         192.168.12.0/24[V]   \
                                     0          Se1/0      point2point 
403    300         1.1.1.1/32[V]     0          Se1/0      point2point 
404    Aggregate   192.168.45.0/24[V]   \
                                     0                                 
405    Untagged    5.5.5.5/32[V]     0          Se2/0      point2point 
406    Untagged    192.168.56.0/24[V]   \
                                     0          Se2/0      point2point 
407    Pop tag     192.168.23.0/24   0          Se1/0      point2point

对于pe路由器的直连vpn路由是Aggregate操作

非直连vpn路由是Untagged操作

--------------------------------------

最后的测试效果:

r5#p 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/19/20 ms
r5#
r5#trac
r5#traceroute 1.1.1.1

Type escape sequence to abort.
Tracing the route to 1.1.1.1

1 192.168.45.4 32 msec 20 msec 32 msec
  2 192.168.34.3 [MPLS: Labels 300/205 Exp 0] 40 msec 20 msec 20 msec
  3 192.168.12.2 [MPLS: Label 205 Exp 0] 20 msec 20 msec 28 msec
  4 192.168.12.1 20 msec *  20 msec

---------------------------------------

r1#p 5.5.5.5

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/20/20 ms
r1#trace
r1#traceroute 5.5.5.5

Type escape sequence to abort.
Tracing the route to 5.5.5.5

1 192.168.12.2 20 msec 28 msec 28 msec
  2 192.168.23.3 [MPLS: Labels 301/405 Exp 0] 28 msec 20 msec 20 msec
  3 192.168.45.4 [MPLS: Label 405 Exp 0] 20 msec 20 msec 20 msec
  4 192.168.45.5 20 msec *  20 msec

=============================================

最后是各台路由器的配置:

r1#sh ru
Building configuration...

Current configuration : 722 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r1
!
!
clock timezone CET 1
ip subnet-zero
no ip domain lookup
!
!
!
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface Ethernet0/0
 no ip address
 shutdown
!
interface Serial1/0
 ip address 192.168.12.1 255.255.255.0
!
interface Serial2/0
 no ip address
 shutdown
!
interface Serial3/0
 no ip address
 shutdown
!
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 passive-interface Loopback0
 network 0.0.0.0 255.255.255.255 area 0
!
ip classless
no ip http server
!
!
!        
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
 login
!
end

上一页  [1] [2] [3] 下一页  

文章录入:csh    责任编辑:csh 

-------------------------------------------
r2#sh ru
Building configuration...

Current configuration : 1524 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r2
!
!
clock timezone CET 1
ip subnet-zero
no ip domain lookup
!
!
ip vrf vpn1
 rd 100:1
 route-target export 100:1
 route-target import 100:1
ip cef
mpls label range 200 299
tag-switching tdp router-id Loopback0
!        
!
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Ethernet0/0
 no ip address
 shutdown
!
interface Serial1/0
 ip vrf forwarding vpn1
 ip address 192.168.12.2 255.255.255.0
!
interface Serial2/0
 ip address 192.168.23.2 255.255.255.0
 tag-switching ip
!
interface Serial3/0
 no ip address
 shutdown
!
router ospf 1
 router-id 2.2.2.2
 log-adjacency-changes
 passive-interface Loopback0
 network 2.2.2.2 0.0.0.0 area 0
 network 192.168.23.0 0.0.0.255 area 0
!
router ospf 22 vrf vpn1
 log-adjacency-changes
 redistribute bgp 1 subnets
 network 192.168.12.0 0.0.0.255 area 0
!
router bgp 1
 no synchronization
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 4.4.4.4 remote-as 1
 neighbor 4.4.4.4 update-source Loopback0
 no auto-summary
 !
 address-family ipv4 vrf vpn1
 redistribute ospf 22 match internal external 1 external 2
 no auto-summary
 no synchronization
 exit-address-family
 !
 address-family vpnv4
 neighbor 4.4.4.4 activate
 neighbor 4.4.4.4 send-community both
 no auto-summary
 exit-address-family
!
ip classless
no ip http server
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
 login
!
end

------------------------------------

r3#sh ru
Building configuration...

Current configuration : 842 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r3
!
!
clock timezone CET 1
ip subnet-zero
no ip domain lookup
!
ip cef
mpls label range 300 399
tag-switching tdp router-id Loopback0
!
!
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!        
interface Ethernet0/0
 no ip address
 shutdown
!
interface Serial1/0
 ip address 192.168.34.3 255.255.255.0
 tag-switching ip
!
interface Serial2/0
 ip address 192.168.23.3 255.255.255.0
 tag-switching ip
!
interface Serial3/0
 no ip address
 shutdown
!
router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 passive-interface Loopback0
 network 0.0.0.0 255.255.255.255 area 0
!
ip classless
no ip http server
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
 login
!
end

-----------------------------------------
r4#sh ru
Building configuration...

Current configuration : 1542 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r4
!
!
clock timezone CET 1
ip subnet-zero
no ip domain lookup
!
!
ip vrf vpn1
 rd 100:1
 route-target export 100:1
 route-target import 100:1
ip cef
mpls label range 400 499
tag-switching tdp router-id Loopback0
!        
!
!
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
!
interface Ethernet0/0
 no ip address
 shutdown
!
interface Serial1/0
 ip address 192.168.34.4 255.255.255.0
 tag-switching ip
!
interface Serial2/0
 ip vrf forwarding vpn1
 ip address 192.168.45.4 255.255.255.0
 tag-switching ip
!
interface Serial3/0
 no ip address
 shutdown
!
router ospf 1
 router-id 4.4.4.4
 log-adjacency-changes
 passive-interface Loopback0
 network 4.4.4.4 0.0.0.0 area 0
 network 192.168.34.0 0.0.0.255 area 0
!
router ospf 44 vrf vpn1
 log-adjacency-changes
 redistribute bgp 1 subnets
 network 192.168.45.0 0.0.0.255 area 0
!
router bgp 1
 no synchronization
 bgp router-id 4.4.4.4
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 1
 neighbor 2.2.2.2 update-source Loopback0
 no auto-summary
 !
 address-family ipv4 vrf vpn1
 redistribute ospf 44 match internal external 1 external 2
 no auto-summary
 no synchronization
 exit-address-family
 !
 address-family vpnv4
 neighbor 2.2.2.2 activate
 neighbor 2.2.2.2 send-community both
 no auto-summary
 exit-address-family
!
ip classless
no ip http server
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
 login
!
end

----------------------------------------------
r5#sh ru
Building configuration...

Current configuration : 736 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r5
!
!
clock timezone CET 1
ip subnet-zero
no ip domain lookup
!
!
!
!
interface Loopback0
 ip address 5.5.5.5 255.255.255.255
!
interface Ethernet0/0
 no ip address
 shutdown
!
interface Serial1/0
 ip address 192.168.56.7 255.255.255.0
!
interface Serial2/0
 ip address 192.168.45.5 255.255.255.0
!
interface Serial3/0
 no ip address
 shutdown
!
router ospf 1
 router-id 5.5.5.5
 log-adjacency-changes
 passive-interface Loopback0
 network 0.0.0.0 255.255.255.255 area 0
!
ip classless
no ip http server
!
!
!
!        
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
 login
!
end

上一页  [1] [2] [3] 

文章录入:csh    责任编辑:csh

(0)

相关推荐

  • MPLS 基础MPLS-VPN 标签分析

    R1---(R2---R3---R4)--R5|__EBGP__|_____IBGP______|__EBGP_| 12.0/24          23.0/24      34.0/24   45.0/24 R2-R 4是MPLs和MPLS-VPN域 R2和R4上的vrf:ip vrf vpn1 rd 100:1 route-target export 100:1 route-target import 100:1 r4#sh ip vrf dVRF vpn1; default RD 100

  • Java基础学习之标签

    一.语法 label: @Test public void test3() { inner: for (int i = 0; i < 5; i++) { if (i == 3) { break inner; } System.out.println(i); } System.out.println("结尾"); } 注意: 标签只能在for循环上面,中间不要插入语句 因此,标签应放在循环语句前,之间不应有其他语句. 二.控制循环 continue会退回最内层的循环开头, 并继续执

  • .NET基础之自定义泛型分析

    本文实例分析了.NET基础之自定义泛型.分享给大家供大家参考.具体分析如下: 在.NET中泛型使用非常频繁,在控制台应用程序中,默认的引入了System.Collection.Generics名称空间,其中就提供了我们经常使用的泛型:List<T>和Dictionary<T>,相信用过它们的都知道它们的强大.还有一种我们经常使用的简单的泛型:System.Nullable<T>,即可空类型.我们可以:   System.Nullable<int> nulla

  • Flink DataStream基础框架源码分析

    目录 引言 概览 深入DataStream DataStream 属性和方法 类体系 Transformation 属性和方法 类体系 StreamOperator 属性和方法 类体系 Function DataStream生成提交执行的Graph StreamGraph 属性和方法 StreamGraph生成 JobGraph 属性和方法 总结 引言 希望通过对Flink底层源码的学习来更深入了解Flink的相关实现逻辑.这里新开一个Flink源码解析的系列来深入介绍底层源码逻辑.说明:这里默

  • seo标题标签分析

    排在搜索引擎搜索结果前几页的网页或网站中,一般是这个网页或网站的标题标签(Title Tag)中包含着搜索关键词.所以,反过来,要让自己网页或网站排到搜索结果的前列,网页的标题标签(Title Tag)非常重要. 网页的标题标签(Title Tag)要怎么写才是最优化?要领如下几点: 1.网页的标题标签有效长度是64个字节,汉语是32个字.长出来的部分无益有弊.为什么网页的标题标签太长反而不好? 2.标题标签中务必出现这个页面的关键词,或者关键字词组.关键词和关键字词组的位置也有关系.同样条件下

  • Go语言基础闭包的原理分析示例详解

    目录 一. 闭包概述 二. 代码演示 运行结果 代码说明 一. 闭包概述 闭包就是解决局部变量不能被外部访问的一种解决方案 闭包是把函数当作返回值的一种应用 二. 代码演示 总体思想为:在函数内部定义局部变量,把另一个函数当作返回值,局部变量对于返回值函数相当于全部变量,所以多次调用返回值函数局部变量的值跟随变化. // closure.go package main import ( "fmt" "strings" ) func main() { f := clo

  • IP的出路-MPLS简介

    随着Internet的蓬勃发展,人们对应用也提出了更高的需求.由于Internet缺乏有效的流量和网络带宽管理手段,网络经常会发生拥塞.无法提供服务质量(QoS)保证,使得很多应用如语音和视频等,对于目前的IP技术来说是力不从心.而新兴的多协议标记交换技术(MPLS)有望解决这一问题. MPLS的工作原理按照当前的定义,MPLS是基于标记的IP路由选择方法.这些标记可以被用来代表逐跳式或者显式路由,并指明服务质量(QoS).虚拟专网以及影响一种特定类型的流量(或一个特殊用户的流量)在网络上的传输

  • MPLS路由和控制结构

    CCIP考试 642-611 - Implementing Cisco MPLS考试课程要测验这些技巧. 你必须理解有关整个MPLS结构有多种概念.MPLS结构定义为IP骨干网如何建立标签转发表和实际提供转发标签的通信服务.关键的概念如下:转发等价类:MPLS控制面板:MPLS转发面板:标签分发协议. MPLS路由器基本上是以转发IP数据包同样的方式做出转发标签数据包.MPLS路由器将查验进入网络的数据包上的标签,然后咨询转发表以便验证转发标签数据包的接口,接下来将转发这个数据包. 完成这个过程

  • BGPMPLS VPN的实现技术

    BGP/MPLS VPN的实现技术 摘要 MPLS VPN技术是未来构建VPN的发展方向,越来越受到客户和运营商的青睐.BGP/MPLS VPN是第三层MPLS VPN技术.本文在对VRF.RD.RT几个重要概念进行解释之后,对BGP/MPLS VPN的数据转发过程和路由信息分发过程进行了较为详细的叙述.最后通过分析BGP/MPLS VPN的特点,分析了其市场前景. 关键词 多协议标签交换(MPLS) 虚拟局域网(VPN) 一.VPN技术概述 VPN(Virtual Private Networ

  • 网络基础学习之十八主要路由器技术

    路由器我们知道是一个相当复杂的设备,它的复杂性并不在于它的硬件如何庞大,而在于它的软件技术相当复杂.目前全球能生产出中.高档路由器的也只有少数的那么几家,国内就更少了.为了对路由器技术有一个较全面的了解,本节就路由器技术的几个重要方面作如下介绍. 一.主要路由协议 路由协议是路由器软件中重要的组成部分.路由器的路由功能就是通过这些路由协议来实现的,路由协议的作用是用来建立以及维护路由表.路由表是记录一些转发数据到已知目的节点的最佳路径,有了它,只需直接按路径转发数据包即可,可大大提高数据转发的速

随机推荐