首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 网页设计 | 技术专题 | 电子书下载 | 教学视频 | 网页设计 | 平面设计 | 搜索 | 博客 | 论坛
欢迎光临中国IT实验室思科频道
您现在的位置: 中国IT实验室 >> Cisco >> 综合技术 >> Cisco综合 >> 文章正文

Cisco三层VPN流量导入TE隧道转发

文章来源ChinaItLab 作者佚名 更新时间2008-1-2 保存本文保存本文 推荐给好友推荐给好友 收藏本页收藏本页

    最近做了一个MPLS网络的项目,其中一些总结,想写出来分享一下。

    该网络的核心部署MPLS TE和三层VPN,其中三层VPN的私网流量通过MPLS TE隧道进行转发,由于MPLS TE隧道具有资源预留和带宽保证等优势,能够为私网流量转发提供比较好的质量保证,通过TE隧道支持FRR快速重路由切换,当核心网络链路或者节点失效发生时,通过TE FRR切换,可以达到50ms级的流量快速倒换,最大限度的保证核心网络的流量转发。

    正因为如此,才由MPLS TE隧道代替了平常三层VPN中的LDP,作为私网流量在公网转发的通道,所以在整个核心网络的部署中,是不需要部署LDP的。三层VPN的配置和TE的基本配置都很普遍了,因此不是要提到的重点,本文要提的重点,是私网流量引入TE隧道的方式以及对该方式的理解。
    
    

    
    如图所示,R1、R2和R3上均部署MPLS TE,R1和R3作为PE设备部署三层VPN,IGP路由协议采用OSPF。在部署好之后,我们可以在两个PE上看到对应的私网路由信息,如下:

    R1#show ip route vrf vpn1

    Routing Table: vpn1
    Codes: C - connected, S - static, 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
           i - IS-IS, su - IS-IS summary, 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

         13.0.0.0/24 is subnetted, 1 subnets
    C       13.1.2.0 is directly connected, Ethernet4/7
         31.0.0.0/24 is subnetted, 1 subnets
    B       31.1.2.0 [200/0] via 202.1.1.3, 01:54:45


    R3#show ip route vrf vpn1

    Routing Table: vpn1
    Codes: C - connected, S - static, 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
           i - IS-IS, su - IS-IS summary, 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

         13.0.0.0/24 is subnetted, 1 subnets
    B       13.1.2.0 [200/0] via 202.1.1.1, 01:56:41
         31.0.0.0/24 is subnetted, 1 subnets
    C       31.1.2.0 is directly connected, Ethernet4/7
    R3#

    可以看出这时私网路由都指向了对端PE的BGP建链的loopback地址,但是只是有了私网路由,在转发层面上还是不可能通的,因为这个时候私网标签是不能指导公网转发的,但是又必须保证私网标签在到达对端PE之前不会被错误的剥掉,这时就需要公网标签封装在私网标签之外,完成在公网这一段的数据报文转发,以前是LDP的标签,那么现在没有LDP,自然就是TE的标签了,其实这个时候,回想一下,私网流量的转发原理无非就是如此了,不管你外层需要嵌套多少层标签,也只是为了保证BGP分配的私网标签能够正确的被携带到对端PE。

    那么这个时候,需要做的只是在两端PE上配置一条到对端PE BGP建立地址的静态路由指向TE隧道。为什么这样做呢,让我再连贯起来说上一下就清楚了。比如,我在R1上查看到R3上私网地址31.1.2.0/24的路由下一跳是指向202.1.1.3的,这个时候给数据封装一层私网标签;但是202.1.1.3这个地址并不是R1的地址,会继续查路由表,查到下一跳为TE隧道,而该TE隧道是本地的直连接口,于是再封装一层TE隧道的出标签作为公网标签进行转发。这里其实是一个路由迭代的问题,在迭代的过程中也确定了内层标签和外层标签的位置,而这个时候有了公网标签,私网流量自然也能通过TE隧道进行转发了。

    在本文中,配置静态路由就是一种将私网流量引入TE隧道转发的方式;同样的,如果TE隧道支持自动路由,那么通过自动路由的方式也是可以将私网流量引入TE隧道转发的。其实,不论是静态路由还是自动路由,其本质是将BGP的建链地址发布到路由表中,然后通过路由迭代将私网流量引进隧道。

    但是这样的方式,目前看来只是一个实现,因为这样还是有很大局限的,因为所有不同的VPN都会通过同一个TE隧道进行转发,同一隧道对于所有的VPN提供的都是相同的服务质量和带宽资源。还有其他的方式,比如在vrf下面指定该vrf流量选择的TE隧道,这样就可以根据不同的VPN选择不同的TE隧道转发,还有就是根据策略路由指定不同的VPN进入合适的TE隧道等等,由于局限于目前手上的版本,因此只能做这样最简单的实现,但是这里提到这些是希望提醒大家,不要因为我的讲述而限制了大家的思维。

    后面是我得一个简单配置,提供给有兴趣的朋友做参考。

   『R1配置』
    R1#show run
    Building configuration...
    Current configuration : 2071 bytes
    !
    version 12.4
    !
    hostname R1
    !
    ip vrf vpn1
    rd 100:1
    route-target export 100:1
    route-target import 100:1
    !
    !
    mpls traffic-eng tunnels
    !
    interface Tunnel1
    ip unnumbered Loopback1
    tunnel destination 202.1.1.3
    tunnel mode mpls traffic-eng
    tunnel mpls traffic-eng path-option 16 dynamic
    no routing dynamic
    !
    interface Loopback1
    ip address 202.1.1.1 255.255.255.255
    !
    interface Ethernet4/0
    ip address 80.1.2.1 255.255.255.0
    duplex half
    mpls traffic-eng tunnels
    !
    interface Ethernet4/7
    ip vrf forwarding vpn1
    ip address 13.1.2.1 255.255.255.0
    duplex half
    !
    router ospf 1
    mpls traffic-eng router-id Loopback1
    mpls traffic-eng area 0
    log-adjacency-changes
    network 80.1.2.0 0.0.0.255 area 0
    network 202.1.1.1 0.0.0.0 area 0
    !
    router bgp 100
    no synchronization
    bgp log-neighbor-changes
    neighbor 202.1.1.3 remote-as 100
    neighbor 202.1.1.3 update-source Loopback1
    no auto-summary
    !
    address-family vpnv4
    neighbor 202.1.1.3 activate
    neighbor 202.1.1.3 send-community extended
    exit-address-family
    !
    address-family ipv4 vrf vpn1
    redistribute connected
    no synchronization
    exit-address-family
    !
    ip route 202.1.1.3 255.255.255.255 Tunnel1

   『R2配置』

    R2#show run
    Building configuration...
    Current configuration : 1369 bytes
    !
    version 12.4
    !
    hostname R2
    !
    mpls traffic-eng tunnels
    !
    interface Loopback1
    ip address 202.1.1.2 255.255.255.255
    !
    interface Ethernet4/0
    ip address 80.1.2.2 255.255.255.0
    duplex half
    mpls traffic-eng tunnels
    !
    interface Ethernet4/1
    ip address 80.2.3.1 255.255.255.0
    duplex half
    mpls traffic-eng tunnels
    !
    router ospf 1
    mpls traffic-eng router-id Loopback1
    mpls traffic-eng area 0
    log-adjacency-changes
    network 80.1.2.0 0.0.0.255 area 0
    network 80.2.3.0 0.0.0.255 area 0

   『R3配置』
    R3#show run
    Building configuration...
    Current configuration : 2045 bytes
    !
    version 12.4
    !
    hostname R3
    !
    ip vrf vpn1
    rd 100:1
    route-target export 100:1
    route-target import 100:1
    !
    !
    mpls traffic-eng tunnels
    !
    interface Tunnel1
    ip unnumbered Loopback1
    tunnel destination 202.1.1.1
    tunnel mode mpls traffic-eng
    tunnel mpls traffic-eng path-option 16 dynamic
    no routing dynamic
    !
    interface Loopback1
    ip address 202.1.1.3 255.255.255.255
    !
    interface Ethernet4/1
    ip address 80.2.3.2 255.255.255.0
    duplex half
    mpls traffic-eng tunnels
    !
    interface Ethernet4/7
    ip vrf forwarding vpn1
    ip address 31.1.2.1 255.255.255.0
    duplex half
    !
    router ospf 1
    mpls traffic-eng router-id Loopback1
    mpls traffic-eng area 0
    log-adjacency-changes
    network 80.2.3.0 0.0.0.255 area 0
    network 202.1.1.3 0.0.0.0 area 0
    !
    router bgp 100
    no synchronization
    bgp log-neighbor-changes
    neighbor 202.1.1.1 remote-as 100
    neighbor 202.1.1.1 update-source Loopback1
    no auto-summary
    !
    address-family vpnv4
    neighbor 202.1.1.1 activate
    neighbor 202.1.1.1 send-community extended
    exit-address-family
    !
    address-family ipv4 vrf vpn1
    redistribute connected
    no synchronization
    exit-address-family
    !
    ip route 202.1.1.1 255.255.255.255 Tunnel1

   『R1上显示隧道1的出标签』

       R1#show mpls traffic-eng tunnels tunnel 1

    Name: R1_t1                               (Tunnel1) Destination: 202.1.1.3
      Status:
       Admin: up         Oper: up     Path: valid       Signalling: connected

       path option 16, type dynamic (Basis for Setup, path weight 20)

    Config Parameters:
       Bandwidth: 0        kbps (Global)  Priority: 7  7   Affinity: 0x0/0xFFFF
       Metric Type: TE (default)
       AutoRoute:  disabled  LockDown: disabled  Loadshare: 0        bw-based
       auto-bw: disabled

    InLabel  :  -
    OutLabel : Ethernet4/0, 16
    RSVP Signalling Info:
         Src 202.1.1.1, Dst 202.1.1.3, Tun_Id 1, Tun_Instance 11
       RSVP Path Info:
         My Address: 80.1.2.1
         Explicit Route: 80.1.2.2 80.2.3.1 80.2.3.2 202.1.1.3
         Record Route:  NONE
        Tspec: ave rate=0 kbits, burst=1000 bytes, peak rate=0 kbits
      RSVP Resv Info:
         Record Route:  NONE
         Fspec: ave rate=0 kbits, burst=1000 bytes, peak rate=0 kbits
    Shortest Unconstrained Path Info:
       Path Weight: 20 (TE)
       Explicit Route: 80.1.2.1 80.1.2.2 80.2.3.1 80.2.3.2
                       202.1.1.3
    History:
      Tunnel:
      Time since created: 3 hours, 41 minutes
      Time since path change: 3 hours, 39 minutes
      Current LSP:
      Uptime: 3 hours, 39 minutes
    R1#

   『R1上显示私网标签』

   R1#show bgp vpnv4 unicast vrf vpn1 labels
      Network          Next Hop      In label/Out label
   Route Distinguisher: 100:1 (vpn1)
      13.1.2.0/24      0.0.0.0         18/aggregate(vpn1)
      31.1.2.0/24      202.1.1.3       nolabel/18
      
  

【责编:Zenghui】
中国IT教育
相关产品和培训
文章评论
 友情推荐精华
 专题推荐

 ·巧用网络流量 打造健康内网
 ·无线路由器设置从入门到精通
 ·企业网管如何部署你的网络监控系统?
 ·负载均衡技术方案攻略
 ·中国IT实验室2007年技术热点盘点
 ·利用路由实现VPN的配置方法
 ·让你的局域网网速更上一层楼
 ·小命令大作用---Ping
 ·OSPF路由协议专题
 ·三层交换技术专题
 今日更新
 认证培训
 频道精选
 思科频道导航