Lab MPLS TE

TE Tunnel Lab

1、底层、IGP ospf 100、LDP协议的运行
2、MPLS TE功能的开启
r1(config)#ip cef 
r1(config)#mpls traffic-eng tunnels 
r1(config-if)#int e0/0.12    (确保所有接口都要开启TE功能)
r1(config-subif)#mpls traffic-eng tunnels 

r1#show mpls traffic-eng tunnels summary(检查全局TE是否开启)
r1#show mpls traffic-eng tunnels summary                                 
Signalling Summary:                                                      
    LSP Tunnels Process:            not running, disabled                
    Passive LSP Listener:           not registered with RSVP             
    RSVP Process:                   not running                          
    Forwarding:                     disabled                             
    Head: 0 interfaces, 0 active signalling attempts, 0 established      
          0 activations, 0 deactivations                                 
          0 SSO recovery attempts, 0 SSO recovered                       
    Midpoints: 0, Tails: 0                                               
    Periodic reoptimization:        every 3600 seconds, next in 0 seconds
    Periodic FRR Promotion:         Not Running                          
    Periodic auto-bw collection:    every 300 seconds, next in 0 seconds 

r1#show mpls interfaces(查看接口模式下是否开启TE功能)
r1#show mpls interfaces                                                  
Interface              IP            Tunnel   BGP Static Operational     
Ethernet0/0.12         Yes (ldp)     Yes      No  No     Yes             

3、MPLS TE 的 CBR配置(相当于升级 OSPF 协议,增加了 LSA)
r1(config)#router ospf 100
r1(config-router)#mpls traffic-eng router-id loopback 0
r1(config-router)#mpls traffic-eng area 0

r1#show mpls traffic-eng topology
r1#show mpls traffic-eng topology                                      
My_System_id: 1.1.1.1 (ospf 100  area 0)                               
                                                                       
Signalling error holddown: 10 sec Global Link Generation 6             
                                                                       
IGP Id: 1.1.1.1, MPLS TE Id:1.1.1.1 Router Node  (ospf 100  area 0)    
      link[0]: Broadcast, DR: 12.1.1.2, nbr_node_id:2, gen:6           
          frag_id 12, Intf Address:12.1.1.1                            
          TE metric:10, IGP metric:10, attribute flags:0x0             
          SRLGs: None                                                  
          physical_bw: 10000 (kbps), max_reservable_bw_global: 0 (kbps)
          max_reservable_bw_sub: 0 (kbps)                              
                                                                       
                                 Global Pool       Sub Pool            
               Total Allocated   Reservable        Reservable          
               BW (kbps)         BW (kbps)         BW (kbps)           
               ---------------   -----------       ----------          
        bw[0]:            0                0                0          
        bw[1]:            0                0                0          
        bw[2]:            0                0                0          
        bw[3]:            0                0                0          
        bw[4]:            0                0                0          
        bw[5]:            0                0                0          
        bw[6]:            0                0                0          
 --More--                                                              

r1#show ip ospf 
 Routing Process "ospf 100" with ID 1.1.1.1
 Start time: 00:58:21.352, Time elapsed: 00:12:18.104
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 Supports area transit capability
 Event-log enabled, Maximum number of events: 1000, Mode: cyclic
 Router is not originating router-LSAs with maximum metric
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs
 Incremental-SPF disabled
 Minimum LSA interval 5 secs
 Minimum LSA arrival 1000 msecs
 LSA group pacing timer 240 secs
 Interface flood pacing timer 33 msecs
 Retransmission pacing timer 66 msecs
 Number of external LSA 0. Checksum Sum 0x000000
 Number of opaque AS LSA 0. Checksum Sum 0x000000
 Number of DCbitless external and opaque AS LSA 0
 Number of DoNotAge external and opaque AS LSA 0
 Number of areas in this router is 1. 1 normal 0 stub 0 nssa
 Number of areas transit capable is 0
 External flood list length 0
 IETF NSF helper support enabled
 Cisco NSF helper support enabled
 Reference bandwidth unit is 100 mbps
    Area BACKBONE(0)
        Number of interfaces in this area is 2 (1 loopback)
        Area has RRR enabled
        Area has no authentication
        SPF algorithm last executed 00:02:42.712 ago
        SPF algorithm executed 8 times
        Area ranges are
        Number of LSA 16. Checksum Sum 0x07F300
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0

4、MPLS TE的RSVP开启
r1(config)#int e0/0
r1(config-if)#fair-queue (强行让接口变成WFQ)
r1(config-if)#int e0/0.12
r1(config-subif)#ip rsvp bandwidth 1000(相当于预留1M)

r1#show ip rsvp interface
r1#show ip rsvp interface                                              
interface    rsvp  allocated  i/f max  flow max sub max                
Et0/0        ena   0          0        0        0                      
Et0/0.12     ena   0          1M       1M       0                      

5、首端路由器R1 TE tunnel的建立
r1(config)#interface tunnel 14
r1(config-if)#ip unnumbered loopback 0        (借用 loopback 0 来作为转发地址)
r1(config-if)#tunnel destination 4.4.4.4
r1(config-if)#tunnel mode mpls traffic-eng (默认 tunnel 的模式是 GRE)
r1(config-if)#tunnel mpls traffic-eng bandwidth 500(建立 0.5M 的 tunnel 接口,小于预留 1M 合理)
r1(config-if)#tunnel mpls traffic-eng path-option 10 explicit name T4(静态选路)

r1(config-if)#tunnel mpls traffic-eng path-option 10 dynamic (动态选路)
r1(config-if)#tunnel mpls traffic-eng path-option 20 explicit name XX(建立冗余链路 / 可选)

r1(config)#ip explicit-path name T4 enable (默认是自动开启的,推荐使用 enable 关键字)
r1(cfg-ip-expl-path)#next-address 12.1.1.2
r1(cfg-ip-expl-path)#next-address 26.1.1.6
r1(cfg-ip-expl-path)#next-address 36.1.1.3
r1(cfg-ip-expl-path)#next-address 34.1.1.4
r1#show ip explicit-paths                                                 
PATH T4 (strict source route, path complete, generation 6)                
    1: next-address 12.1.1.2                                              
    2: next-address 26.1.1.6                                              
    3: next-address 36.1.1.3                                              
    4: next-address 34.1.1.4                                              

r2#show ip explicit-paths name T4(查看配置的显式路径)
r2(cfg-ip-expl-path)#no index ?    (删除某一跳路径)
  <1-65535>  Entry index number

r1(config)#ip route 4.4.4.4 255.255.255.255 tunnel 14
r1(config)#router ospf 100
r1(config-router)#net 1.1.1.1 0.0.0.0 a 0    (使得 r4 拥有1.1.1.1路由,通过 FIB 对数据包进行回复)
r1#traceroute 4.4.4.4 source 1.1.1.1                                        
                                                                            
Type escape sequence to abort.                                              
Tracing the route to 4.4.4.4                                                
                                                                            
  1 12.1.1.2 [MPLS: Label 2001 Exp 0] 8 msec 16 msec 12 msec                
  2 26.1.1.6 [MPLS: Label 6009 Exp 0] 12 msec 12 msec 8 msec                
  3 36.1.1.3 [MPLS: Label 3008 Exp 0] 12 msec 12 msec 8 msec                
  4 34.1.1.4 12 msec *  8 msec                                              


6、TE tunnel 不需要 LDP 分配其标签(确认 TE 走的是 IP 还是 Label)
r1#show mpls traffic-eng tunnels tunnels 14
r1#show mpls traffic-eng tunnels tunnel 14                                  
                                                                            
Name: r1_t14                              (Tunnel14) Destination: 4.4.4.4   
  Status:                                                                   
    Admin: up         Oper: up     Path: valid       Signalling: connected  
    path option 10, type explicit T4 (Basis for Setup, path weight 40)      
                                                                            
  Config Parameters:                                                        
    Band 500      kbps (Global)  Priority: 7  7   Affinity: 0x0/0xFFFF
    Metric Type: TE (default)                                               
    AutoRoute:  disabled  LockDown: disabled  Loadshare: 500      bw-based  
    auto-bw: disabled                                                       
  Active Path Option Parameters:                                            
    State: explicit path option 10 is active                                
    BandwidthOverride: disabled  LockDown: disabled  Verbatim: disabled     
                                                                            
                                                                            
  InLabel  :  -                                                             
  OutLabel : Ethernet0/0.12, 2001                                           
  RSVP Signalling Info:                                                     
       Src 1.1.1.1, Dst 4.4.4.4, Tun_Id 14, Tun_Instance 6                  
    RSVP Path Info:                                                         
      My Address: 12.1.1.1                                                  
      Explicit Route: 12.1.1.2 26.1.1.2 26.1.1.6 36.1.1.6                   
                      36.1.1.3 34.1.1.3 34.1.1.4 4.4.4.4                    
      Record   Route:   NONE                                                
      Tspec: ave rate=500 kbits, burst=1000 bytes, peak rate=500 kbits      
    RSVP Resv Info:                                                         
      Record   Route:   NONE                                                
      Fspec: ave rate=500 kbits, burst=1000 bytes, peak rate=500 kbits      
  Shortest Unconstrained Path Info:                                         
    Path Weight: 30 (TE)                                                    
    Explicit Route: 12.1.1.1 12.1.1.2 23.1.1.2 23.1.1.3                     
                    34.1.1.3 34.1.1.4 4.4.4.4                               
  History:                                                                  
    Tunnel:                                                                 
      Time since created: 14 minutes, 37 seconds                            
      Time since path change: 12 minutes, 32 seconds                        
      Number of LSP IDs (Tun_Instances) used: 6                             
    Current LSP:                                                            
      Uptime: 12 minutes, 32 seconds                                        
      Selection: reoptimization                                             
    Prior LSP:                                                              
      ID: path option 10 [5]                                                
      Removal Trigger: configuration changed                                

r2#show mpls forwarding-table 
r2#show mpls forwarding-table                                               
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop    
Label      Label      or Tunnel Id     Switched      interface              
2004       Pop Label  1.1.1.1/32       1822          Et0/0.12   12.1.1.1    
2005       6003       1.1.1.1 14 [14]  576           Et0/0.26   26.1.1.6    
2006       Pop Label  6.6.6.6/32       0             Et0/0.26   26.1.1.6    
2007       Pop Label  5.5.5.5/32       0             Et0/0.25   25.1.1.5    
2008       Pop Label  3.3.3.3/32       0             Et0/0.23   23.1.1.3    
2009       Pop Label  34.1.1.0/24      0             Et0/0.23   23.1.1.3    
2010       Pop Label  56.1.1.0/24      0             Et0/0.25   25.1.1.5    
           Pop Label  56.1.1.0/24      0             Et0/0.26   26.1.1.6    
2011       Pop Label  35.1.1.0/24      0             Et0/0.23   23.1.1.3    
           Pop Label  35.1.1.0/24      0             Et0/0.25   25.1.1.5    
2012       Pop Label  36.1.1.0/24      0             Et0/0.23   23.1.1.3    
           Pop Label  36.1.1.0/24      0             Et0/0.26   26.1.1.6    
标亮部分指的是  tunnel-ID 而不是具体的下一跳目的前缀

总结:
MPLS TE 在网络中实验网络规划是以 Tunnel 的方式实现
MPLS TE tunnel 是单向隧道(所以只需要单方向 r1 指向 r4 即可)
MPLS TE tunnel 的目的地址指向的是一个节点而不是一个接口 IP 地址(Tunnel 的目的地址一定是网络中某个路由器的 TE Router-ID)
MPLS TE tunnel 的资源消耗指的是 tunnel 经过的出方向物理接口资源
由于存在 RSVP,所以 LDP 是不需要分配 Label,可以使用该命令验证:r1(config)#no mpls ip
 

原文地址:https://www.cnblogs.com/cyrusxx/p/12824083.html