. 组网需求

l              R1R2R3均支持MPLS,运行OSPF作为MPLS骨干网上的IGP

l              R1R3之间建立双向静态LSP,并检测LSP的有效性和可达性。

 理论基础

     入节点Ingress:报文的入口LER,负责为进入MPLS域的报文添加标签。

      中间节点Transit:MPLS域内部的LSR,根据标签沿着由一系列LSR构成的LSP将报文传送给出口LER。

     出节点Egress:报文的出口LER,负责剥离报文中的标签,并转发给目的网络。



R1--------int s0/6/0--------R2---------int s0/6/1-----------R4



R1配置:

<R1>dis ip int br

*down: administratively down

(s): spoofing

Interface                                Physical   Protocol   IP Address      

LoopBack0                                  up         up(s)    1.1.1.9         

Serial0/6/0                                up         up       10.1.1.1 


ospf 1

 area 0.0.0.0

  network 1.1.1.9 0.0.0.0

  network 10.1.1.0 0.0.0.255

#

 static-lsp ingress AtoC destination 3.3.3.9 32 nexthop 10.1.1.2 out-label 30

 static-lsp egress CtoA incoming-interface Serial0/6/0 in-label 70





R2配置:



[R2]dis ip int br

*down: administratively down

(s): spoofing

Interface                                Physical   Protocol   IP Address      

LoopBack0                                  up         up(s)    2.2.2.9         

Serial0/6/0                                up         up       10.1.1.2        

Serial0/6/1                                up         up       20.1.1.1 


ospf 1

 area 0.0.0.0

  network 2.2.2.9 0.0.0.0

  network 10.1.1.0 0.0.0.255

  network 20.1.1.0 0.0.0.255

#

 static-lsp transit AtoC incoming-interface Serial0/6/0 in-label 30 nexthop 20.1.1.2 out-label 50

 static-lsp transit CtoA incoming-interface Serial0/6/1 in-label 40 nexthop 10.1.1.1 out-label 70

R4配置:

[R4]dis ip int br

*down: administratively down

(s): spoofing

Interface                                Physical   Protocol   IP Address      

LoopBack0                                  up         up(s)    3.3.3.9         

Serial0/6/0                                down       down     unassigned      

Serial0/6/1                                up         up       20.1.1.2  




ospf 1

 area 0.0.0.0

  network 3.3.3.9 0.0.0.0

  network 20.1.1.0 0.0.0.255

#

 static-lsp egress AtoC incoming-interface Serial0/6/1 in-label 50

 static-lsp ingress CtoA destination 1.1.1.9 32 nexthop 20.1.1.1 out-label 40





检测:


从R4上发ping 包

在R1上看debuing 信息



return

[R4] ping lsp ipv4 1.1.1.9 32

 LSP PING FEC: LDP IPV4 PREFIX 1.1.1.9/32 : 100  data bytes, press CTRL_C to break

 Reply from 10.1.1.1: bytes=100 Sequence=1 time = 10 ms

 Reply from 10.1.1.1: bytes=100 Sequence=2 time = 10 ms

 Reply from 10.1.1.1: bytes=100 Sequence=3 time = 1 ms

 Reply from 10.1.1.1: bytes=100 Sequence=4 time = 10 ms

 Reply from 10.1.1.1: bytes=100 Sequence=5 time = 1 ms


 --- FEC: LDP IPV4 PREFIX 1.1.1.9/32 ping statistics ---

 5 packet(s) transmitted

 5 packet(s) received

 0.00% packet loss

 round-trip min/avg/max = 1/6/10 ms


[R4]



<R1>dis debugging

 LSPC packet debug switch is on

 LSPC event debug switch is on

 LSPC error debug switch is on



<R1>  

*Apr 11 00:10:51:719 2013 R1 LSPC/7/Event:

 Receive echo request message on egress.

*Apr 11 00:10:51:719 2013 R1 LSPC/7/Packet:

 Receive echo request message on egress. Length: 100  

 00 01 00 00 01 02 00 00 00 00 00 03 00 00 00 01

 d5 10 7e 0b 54 7a 00 00 00 00 00 00 00 00 00 00

 00 01 00 0c 00 01 00 05 01 01 01 09 20 00 00 00

 00 03 00 30 02 41 42 43 44 45 46 47 48 49 4a 4b

 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 41

 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51

 52 53 54 55

*Apr 11 00:10:51:719 2013 R1 LSPC/7/Packet:

 Send echo reply message on egress. Length: 100  

 00 01 00 00 02 02 03 01 00 00 00 03 00 00 00 01

 d5 10 7e 0b 54 7a 00 00 d5 10 7e 0b 35 c2 00 00

 00 01 00 0c 00 01 00 05 01 01 01 09 20 00 00 00

 00 03 00 30 02 41 42 43 44 45 46 47 48 49 4a 4b

 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 41

 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51

 52 53 54 55

*Apr 11 00:10:51:719 2013 R1 LSPC/7/Event:

 Receive echo request message on egress, reply successfully. 

*Apr 11 00:10:53:703 2013 R1 LSPC/7/Event:

 Receive echo request message on egress.

*Apr 11 00:10:53:703 2013 R1 LSPC/7/Packet:

 Receive echo request message on egress. Length: 100  

 00 01 00 00 01 02 00 00 00 00 00 03 00 00 00 02

 d5 10 7e 0d eb 85 00 00 00 00 00 00 00 00 00 00

 00 01 00 0c 00 01 00 05 01 01 01 09 20 00 00 00

 00 03 00 30 02 41 42 43 44 45 46 47 48 49 4a 4b

 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 41

 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51

 52 53 54 55

*Apr 11 00:10:53:703 2013 R1 LSPC/7/Packet:

 Send echo reply message on egress. Length: 100  

 00 01 00 00 02 02 03 01 00 00 00 03 00 00 00 02

 d5 10 7e 0d eb 85 00 00 d5 10 7e 0d bd 70 00 00

 00 01 00 0c 00 01 00 05 01 01 01 09 20 00 00 00

 00 03 00 30 02 41 42 43 44 45 46 47 48 49 4a 4b

 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 41

 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51

 52 53 54 55

*Apr 11 00:10:53:703 2013 R1 LSPC/7/Event:

 Receive echo request message on egress, reply successfully. 

*Apr 11 00:10:55:703 2013 R1 LSPC/7/Event:

 Receive echo request message on egress.

*Apr 11 00:10:55:703 2013 R1 LSPC/7/Packet:

 Receive echo request message on egress. Length: 100  

 00 01 00 00 01 02 00 00 00 00 00 03 00 00 00 03

 d5 10 7e 0f 8a 3d 00 00 00 00 00 00 00 00 00 00

 00 01 00 0c 00 01 00 05 01 01 01 09 20 00 00 00

 00 03 00 30 02 41 42 43 44 45 46 47 48 49 4a 4b

 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 41

 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51

 52 53 54 55

*Apr 11 00:10:55:703 2013 R1 LSPC/7/Packet:

 Send echo reply message on egress. Length: 100  

 00 01 00 00 02 02 03 01 00 00 00 03 00 00 00 03

 d5 10 7e 0f 8a 3d 00 00 d5 10 7e 0f 37 0a 00 00

 00 01 00 0c 00 01 00 05 01 01 01 09 20 00 00 00

 00 03 00 30 02 41 42 43 44 45 46 47 48 49 4a 4b

 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 41

 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51

 52 53 54 55

*Apr 11 00:10:55:703 2013 R1 LSPC/7/Event:

 Receive echo request message on egress, reply successfully. 

*Apr 11 00:10:57:703 2013 R1 LSPC/7/Event:

 Receive echo request message on egress.

*Apr 11 00:10:57:703 2013 R1 LSPC/7/Packet:

 Receive echo request message on egress. Length: 100  

 00 01 00 00 01 02 00 00 00 00 00 03 00 00 00 04

 d5 10 7e 11 28 f5 00 00 00 00 00 00 00 00 00 00

 00 01 00 0c 00 01 00 05 01 01 01 09 20 00 00 00

 00 03 00 30 02 41 42 43 44 45 46 47 48 49 4a 4b

 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 41

 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51

 52 53 54 55

*Apr 11 00:10:57:703 2013 R1 LSPC/7/Packet:

 Send echo reply message on egress. Length: 100  

 00 01 00 00 02 02 03 01 00 00 00 03 00 00 00 04

 d5 10 7e 11 28 f5 00 00 d5 10 7e 11 b8 51 00 00

 00 01 00 0c 00 01 00 05 01 01 01 09 20 00 00 00

 00 03 00 30 02 41 42 43 44 45 46 47 48 49 4a 4b

 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 41

 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51

 52 53 54 55

*Apr 11 00:10:57:703 2013 R1 LSPC/7/Event:

 Receive echo request message on egress, reply successfully. 

*Apr 11 00:10:59:703 2013 R1 LSPC/7/Event:

 Receive echo request message on egress.

*Apr 11 00:10:59:703 2013 R1 LSPC/7/Packet:

 Receive echo request message on egress. Length: 100  

 00 01 00 00 01 02 00 00 00 00 00 03 00 00 00 05

 d5 10 7e 13 c7 ae 00 00 00 00 00 00 00 00 00 00

 00 01 00 0c 00 01 00 05 01 01 01 09 20 00 00 00

 00 03 00 30 02 41 42 43 44 45 46 47 48 49 4a 4b

 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 41

 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51

 52 53 54 55

*Apr 11 00:10:59:703 2013 R1 LSPC/7/Packet:

 Send echo reply message on egress. Length: 100  

 00 01 00 00 02 02 03 01 00 00 00 03 00 00 00 05

 d5 10 7e 13 c7 ae 00 00 d5 10 7e 13 35 c2 00 00

 00 01 00 0c 00 01 00 05 01 01 01 09 20 00 00 00

 00 03 00 30 02 41 42 43 44 45 46 47 48 49 4a 4b

 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 41

 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51

 52 53 54 55

*Apr 11 00:10:59:703 2013 R1 LSPC/7/Event:

 Receive echo request message on egress, reply successfully. 

<R1>

<R1>

<R1>dis mpls static-lsp

total statics-lsp : 2

Name            FEC                I/O Label  I/O If                      State

AtoC            3.3.3.9/32         NULL/30    -/S0/6/0                    Up   

CtoA            -/-                70/NULL    S0/6/0/-                    Up   




[R2] dis mpls static-lsp

total statics-lsp : 2

Name            FEC                I/O Label  I/O If                      State

AtoC            -/-                30/50      S0/6/0/S0/6/1               Up   

CtoA            -/-                40/70      S0/6/1/S0/6/0               Up   



[R4]dis mpls static-lsp

total statics-lsp : 2

Name            FEC                I/O Label  I/O If                      State

AtoC            -/-                50/NULL    S0/6/1/-                    Up   

CtoA            1.1.1.9/32         NULL/40    -/S0/6/1                    Up   

[R4]