Lab3 配置Frame-mode MPLS 及其验证

主页------MPLS

Lab 3配置Frame-mode MPLS及其验证

I.           更新日志

2006.05.10 初始版本

II.         实验环境

R1 R2 R3 R4 IOS 12.2(11)T

拓朴

III.     实验日志

1.       启用CEF

CEFMPLS运行的基础,负责标签的插入和剥离。可以在全局模式下通过ip cef命令来启用,另外最好确认是否某个特定端口CEF被禁止,如果被禁止可以通过ip route-cache cef命令在端口配置模式下启用。

R2(config)#ip cef distributed

R2(config)#interface Fa1/0

R2(config-if)#ip route-cache cef

2.       IGP 路由协议配置

路由协议配置的目的是内部网络的通畅。本次实验中使用OSPF

R2(config)#router ospf 100

R2(config)#network 10.10.10.0 0.0.0.255 area 0

3.      标签协议配置

思科设备支持两种标签协议LDPTDP,不同版本可能缺省使用的标签协议不同,本实验使用LDP,可以使用mpls label protocol ldp 命令在全局或者端口配置模式下使用LDP协议。

R2(config)#mpls label protocol ldp

R2(config)#mpls ldp router-id loopback 0 缺省情况使用最高IP地址作为router id

4.      端口启用MPLS

R2(config)#interface fa1/0

R2(config-if)#mpls ip

R2(config)#interface fa2/0

R2(config-if)#mpls ip

5.      MPLS验证

1)        CEF验证

R2#sh ip cef

Prefix              Next Hop             Interface

0.0.0.0/0           drop                 Null0 (default route handler entry)

0.0.0.0/32          receive

10.10.10.0/30       attached             FastEthernet1/0

10.10.10.0/32       receive

10.10.10.1/32       10.10.10.1           FastEthernet1/0

10.10.10.2/32       receive

10.10.10.3/32       receive

10.10.10.4/30       attached             FastEthernet2/0

10.10.10.4/32       receive

10.10.10.5/32       receive

10.10.10.6/32       10.10.10.6           FastEthernet2/0

10.10.10.7/32       receive

10.10.10.8/30       10.10.10.6           FastEthernet2/0

10.10.10.101/32     10.10.10.1           FastEthernet1/0

10.10.10.102/32     receive

10.10.10.103/32     10.10.10.6           FastEthernet2/0

10.10.10.104/32     10.10.10.6           FastEthernet2/0

224.0.0.0/4         drop

224.0.0.0/24        receive

255.255.255.255/32  receive

对于端口也可以使用show cef interface 命令进行验证(IP CEF switching enabled)

2)        MPLS Forwarding验证

R2#sh mpls interfaces

Interface              IP            Tunnel   Operational

FastEthernet1/0        Yes (ldp)     No       Yes        

FastEthernet2/0        Yes (ldp)     No       Yes     (Tunnel用于MPLS TE)

3)        LDP Discovery验证

R2#show mpls ldp discovery

 Local LDP Identifier:

    10.10.10.102:0

    Discovery Sources:

    Interfaces:

        FastEthernet1/0 (ldp): xmit/recv

            LDP Id: 10.10.10.101:0

        FastEthernet2/0 (ldp): xmit/recv

            LDP Id: 10.10.10.103:0

4)        LDP neighbor 验证

R2#show mpls ldp neighbor

    Peer LDP Ident: 10.10.10.101:0; Local LDP Ident 10.10.10.102:0

        TCP connection: 10.10.10.101.646 - 10.10.10.102.11003

        State: Oper; Msgs sent/rcvd: 30/30; Downstream

        Up time: 00:16:33

        LDP discovery sources:

          FastEthernet1/0, Src IP addr: 10.10.10.1

        Addresses bound to peer LDP Ident:

          10.10.10.1      10.10.10.101   

    Peer LDP Ident: 10.10.10.103:0; Local LDP Ident 10.10.10.102:0

        TCP connection: 10.10.10.103.11001 - 10.10.10.102.646

        State: Oper; Msgs sent/rcvd: 11/11; Downstream

        Up time: 00:01:22

        LDP discovery sources:

          FastEthernet2/0, Src IP addr: 10.10.10.6

        Addresses bound to peer LDP Ident:

          10.10.10.9      10.10.10.6      10.10.10.103

5)        Control Plane工作流程

使用命令来验证10.10.10.104/32control plane工作机制:

从下面的输出可以看出R4发送一个implicit null或者POPlabelR3implicit null label告诉前一跳路由器R3如果有R1发送到10.10.10.104要提前POPlabel,如果R4发送的是explicit-null label则上游路由器不用提前POPlabel

R4#sh mpls ldp bindings

  ……

  tib entry: 10.10.10.104/32, rev 4

        local binding:  tag: imp-null

        remote binding: tsr: 10.10.10.103:0, tag: 19

从下面的输出可以看出R3会给10.10.10.104/32添加标签为19,该标签会发给上游路由器R2,而到下游的话根据上面的解释应该是执行POP掉标签的动作。

R3#show mpls forwarding-table

Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop   

tag    tag or VC   or Tunnel Id      switched   interface             

16     Pop tag     10.10.10.0/30     570        Fa2/0      10.10.10.5  

17     16          10.10.10.101/32   590        Fa2/0      10.10.10.5  

18     Pop tag     10.10.10.102/32   0          Fa2/0      10.10.10.5  

19     Pop tag     10.10.10.104/32   570        Fa1/0      10.10.10.10 

从下面的输出可以看出R2收到R3指定的标签19,并且自己也指定标签为19,发给上游路由器R1

R2#show mpls forwarding-table

Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop   

tag    tag or VC   or Tunnel Id      switched   interface             

16     Pop tag     10.10.10.101/32   570        Fa1/0      10.10.10.1  

17     Pop tag     10.10.10.8/30     570        Fa2/0      10.10.10.6  

18     Pop tag     10.10.10.103/32   0          Fa2/0      10.10.10.6  

19     19          10.10.10.104/32   590        Fa2/0      10.10.10.6 

6)        Data Plane 工作流程

如果有数据从R110.10.10.104/32data forwarding流程如下:

R1R110.10.10.104/32的数据指定标签

R2执行LFIB查询交换标签从1919发给R3

R3作为前一跳(penultimate hop)执行POP label操作,去掉标签19发给R4

IV.     参考资料和遗留问题

遗留问题:Cell-mode下的MPLS配置没有做。

参考资料:CiscoPress MPLS Configuration on Cisco IOS Software (ISBN: 1587051990