您现在的位置: IT培训 > CCIE > CCIE常见问答 > 正文

【CCIE考点MPLS/MPLS_VPN】6.查看LDP邻居相关信息

发布时间:2013-03-13 15:08:36

(1)在R1上查看LDP discovery情况:
r1#sh mpls ldp discovery detail
 Local LDP Identifier:
    1.1.1.1:0
    Discovery Sources:
    Interfaces:
        Serial1/1 (ldp): xmit/recv
            Enabled: Interface config
            Hello interval: 5000 ms; Transport IP addr: 1.1.1.1
            LDP Id: 2.2.2.2:0; no route to transport addr
              Src IP addr: 12.1.1.2; Transport IP addr: 2.2.2.2
              Hold time: 15 sec; Proposed local/peer: 15/15 sec
r1#
说明:Local LDP Identifier 是每台LSR都必须有的,这个ID用6个字节表示,前4个节字称为Rotuer-ID,先选loopback地址最大的,然后是物理接口,它的选举方法和OSPF Rotuer-ID相同,后面2个字节是表示标签空间的,也就是标签是基于设备还是基于接口,如果是基于设备,就是0,可以从上面看出,1.1.1.1:0中,1.1.1.1表示R1的Rotuer-ID,而0表示标签是基于设备的。再看后面还有个Transport IP ,而这个IP默认是选用Rotuer-ID的地址,这个地址在建邻居时非常重要,是会话的源地址,如果这个地址对方没有路由可达,那么就不可能建起邻居。所以一定要保证双方Transport IP 是路由相通的。从上面结果中还可以看出,R1已经收到了对方R2的hello,对方Transport IP是2.2.2.2,也就是对方的loopback0地址,而因为这个地址不在OSPF进程里,所以R1不能到达,也就不能建邻居,后面提示为“no route to transport addr”。
(2)在R2上查看LDP discovery情况:
r2#sh mpls ldp discovery detail
 Local LDP Identifier:
    2.2.2.2:0
    Discovery Sources:
    Interfaces:
        Serial1/0 (ldp): xmit/recv
            Enabled: Interface config
            Hello interval: 5000 ms; Transport IP addr: 2.2.2.2
            LDP Id: 3.3.3.3:0; no route to transport addr
              Src IP addr: 23.1.1.3; Transport IP addr: 3.3.3.3
              Hold time: 15 sec; Proposed local/peer: 15/15 sec
        Serial1/1 (ldp): xmit/recv
            Enabled: Interface config
            Hello interval: 5000 ms; Transport IP addr: 2.2.2.2
            LDP Id: 1.1.1.1:0; no route to transport addr
              Src IP addr: 12.1.1.1; Transport IP addr: 1.1.1.1
              Hold time: 15 sec; Proposed local/peer: 15/15 sec
r2#
说明:可以看出,R2的Rotuer-ID是2.2.2.2,这个地址也就是Transport IP,而R1的Transport IP是1.1.1.1,从上面也看出这两个地址是路由上互不相通的,所以不可能建立LDP邻居。
 
(3)解决邻居建立问题:
说明:要解决邻居建立问题,就要让双方的Transport IP能够相通,而Transport IP就是选用Rotuer-ID的IP地址,可以修改Rotuer-ID为可路由的接口,即可解决Transport IP互通。
 
改R1Router-Id为S1/1接口地址
r1(config)#mpls ldp router-id serial 1/1 force     force说明立即生效
r1(config)#exi
 
查看结果:
r1#sh mpls ldp discovery detail
 Local LDP Identifier:
    12.1.1.1:0
    Discovery Sources:
    Interfaces:
        Serial1/1 (ldp): xmit/recv
            Enabled: Interface config
            Hello interval: 5000 ms; Transport IP addr: 12.1.1.1
            LDP Id: 2.2.2.2:0; no route to transport addr
              Src IP addr: 12.1.1.2; Transport IP addr: 2.2.2.2
              Hold time: 15 sec; Proposed local/peer: 15/15 sec
r1#
说明:可以看到Rotuer-ID已经改成接口S1/1的地址12.1.1.1,Transport IP也随即变成了12.1.1.1。
 
    R1的Transport IP对R2来说已经可达了,可是R2的Transport IP还是自己的loopback口地址,R1不能到达,所以还是不能建邻居。Transport IP默认选用Rotuer-ID的地址,但我们可以明确指定Transport IP为某个接口的地址,这次我们直接改R2的Transport IP地址为S1/1的接口地址,Rotuer-ID不变:
先看没改之前:
r2#sh mpls ldp discovery detail
 Local LDP Identifier:
    2.2.2.2:0
    Discovery Sources:
    Interfaces:
        Serial1/0 (ldp): xmit/recv
            Enabled: Interface config
            Hello interval: 5000 ms; Transport IP addr: 2.2.2.2
            LDP Id: 3.3.3.3:0; no route to transport addr
              Src IP addr: 23.1.1.3; Transport IP addr: 3.3.3.3
              Hold time: 15 sec; Proposed local/peer: 15/15 sec
        Serial1/1 (ldp): xmit/recv
            Enabled: Interface config
            Hello interval: 5000 ms; Transport IP addr: 2.2.2.2
            LDP Id: 12.1.1.1:0; no host route to transport addr
              Src IP addr: 12.1.1.1; Transport IP addr: 12.1.1.1
              Hold time: 15 sec; Proposed local/peer: 15/15 sec
              Reachable via 12.1.1.0/24
r2#conf t
 
现在修改:
r2(config)#int s1/1
r2(config-if)#mpls ldp discovery transport-address interface
r2(config-if)#exi
 
再看:
r2#sh mpls ldp discovery detail
 Local LDP Identifier:
    2.2.2.2:0
    Discovery Sources:
    Interfaces:
        Serial1/0 (ldp): xmit/recv
            Enabled: Interface config
            Hello interval: 5000 ms; Transport IP addr: 2.2.2.2
            LDP Id: 3.3.3.3:0; no route to transport addr
              Src IP addr: 23.1.1.3; Transport IP addr: 3.3.3.3
              Hold time: 15 sec; Proposed local/peer: 15/15 sec
        Serial1/1 (ldp): xmit/recv
            Enabled: Interface config
            Hello interval: 5000 ms; Transport IP addr: 12.1.1.2
            LDP Id: 12.1.1.1:0; no host route to transport addr
              Src IP addr: 12.1.1.1; Transport IP addr: 12.1.1.1
              Hold time: 15 sec; Proposed local/peer: 15/15 sec
              Reachable via 12.1.1.0/24
r2#
说明:可以看到,s1/1上Transport IP已经不再是Router-ID的地址,已经被改成本接口地址了。但是接口S1/0还是使用原来Router-ID的地址。
    但是邻居还是不会有,因为R2上直接改接口为Transport IP,是要重启进程才能生效的:
r2#cle mpls ldp neighbor *
r2#
再查看邻居:
r2#sh mpls ldp neighbor
    Peer LDP Ident: 12.1.1.1:0; Local LDP Ident 2.2.2.2:0
        TCP connection: 12.1.1.1.646 - 12.1.1.2.11155
        State: Oper; Msgs sent/rcvd: 9/9; Downstream
        Up time: 00:00:43
        LDP discovery sources:
          Serial1/1, Src IP addr: 12.1.1.1
        Addresses bound to peer LDP Ident:
          15.1.1.1        12.1.1.1        1.1.1.1        
r2#
说明:可以看到,邻居已经有了,并且可以看出端口号是646。
(4)再来关心R2和R3的邻居:
说明:因为R2现在连R3的接口S1/0的Transport IP还是使用Router-ID的地址2.2.2.2,而R3也到不了2.2.2.2,所以R2和R3之间的LDP邻居关系是建不起来的,我们还是像R2和R1建邻居那样,把S1/0接口的Transport IP改成使用本接口的地址。
r2(config)#int s1/0
r2(config-if)#mpls ldp discovery transport-address interface
r2(config-if)#exi
    而R3的Transport IP还是使用自己的Router-ID地址3.3.3.3,这个地址R2也是无法到达的,在R3上也可以通过将该地址放进OSPF进程来使R2能够ping通,从而建立LDP邻居。
r3(config)#router ospf 2
r3(config-router)#network 3.3.3.3 0.0.0.0 area 0
r3(config-router)#exi
在R2上查看建LDP邻居的源地址:
r2#sh mpls ldp discovery detail
 Local LDP Identifier:
    2.2.2.2:0
    Discovery Sources:
    Interfaces:
        Serial1/0 (ldp): xmit/recv
            Enabled: Interface config
            Hello interval: 5000 ms; Transport IP addr: 23.1.1.2
            LDP Id: 3.3.3.3:0
              Src IP addr: 23.1.1.3; Transport IP addr: 3.3.3.3
              Hold time: 15 sec; Proposed local/peer: 15/15 sec
              Reachable via 3.3.3.3/32
        Serial1/1 (ldp): xmit/recv
            Enabled: Interface config
            Hello interval: 5000 ms; Transport IP addr: 12.1.1.2
            LDP Id: 12.1.1.1:0; no host route to transport addr
              Src IP addr: 12.1.1.1; Transport IP addr: 12.1.1.1
              Hold time: 15 sec; Proposed local/peer: 15/15 sec
              Reachable via 12.1.1.0/24
r2#
说明:可以看到,R2连R3的接口S1/0的Transport IP 已经成功改成了23.1.1.2。
但是R2还是不会有R3的邻居,所以按以前方法重置LDP进程,再看就会有了:
来查看重置后的邻居状态:
r2#sh mpls ldp neighbor
    Peer LDP Ident: 3.3.3.3:0; Local LDP Ident 2.2.2.2:0
        TCP connection: 3.3.3.3.646 - 23.1.1.2.61206
        State: Oper; Msgs sent/rcvd: 10/9; Downstream
        Up time: 00:00:09
        LDP discovery sources:
          Serial1/0, Src IP addr: 23.1.1.3
        Addresses bound to peer LDP Ident:
          23.1.1.3        34.1.1.3        3.3.3.3        
    Peer LDP Ident: 12.1.1.1:0; Local LDP Ident 2.2.2.2:0
        TCP connection: 12.1.1.1.646 - 12.1.1.2.44954
        State: Oper; Msgs sent/rcvd: 10/10; Downstream
        Up time: 00:00:03
        LDP discovery sources:
          Serial1/1, Src IP addr: 12.1.1.1
        Addresses bound to peer LDP Ident:
          15.1.1.1        12.1.1.1        1.1.1.1        
r2#
说明:在R2上可以看见和R3的LDP邻居关系已经建立。
(5)R3跟R4的邻居关系:
说明:R3的Router-ID已经通告进OSPF进程,所以R4也能到达了,那么R4也选择将Loopback地址放loop进OSPF进程来完成和R3的LDP邻居关系建立。
说明:最终保证所有LDP   邻居建立(R1和R2的邻居,R2和R3的邻居,R3和R4的邻居全部都有)。