1. 程式人生 > >MPLS TE基礎配置

MPLS TE基礎配置

MPLS TE CCIE SP

懶惰真是萬惡之源,過年到現在就擠了這麽一篇,不過學習嘛,一步步來。

這篇講MPLS TE的基礎配置。

MPLS的幾大組件就不重復了, 這篇註重配置關鍵點。
以下是我的實驗topology,
技術分享圖片

首先當你要使用MPLS TE的時候,骨幹網的每臺路由器都要開啟此功能。全局與接口命令如下。

全局

mpls traffic-eng tunnels

IGP進程命令
IS-IS
router isis
mpls traffic-eng router-id loopback 0
mpls traffic-eng level-2
metric-style wide //一定要開啟,因為MPLS TE計算metric的方式很復雜

OSPF

router ospf
mpls traffic-eng router-id loopback0
mpls traffic-eng area 0

接口下的命令

物理接口
int f1/0
mpls traffic-eng tunnels
ip rsvp bandwidth <數值>
mpls ip // 必須得開啟,思科IOS設備不像Junos 有 family mpls family LDP 的區別,當接口收到一個帶標簽的報文 沒有此命令路由器會直接 丟棄。

貼一個R2的配置作為參考

R2#sh run | s router
router isis

mpls traffic-eng router-id Loopback0
mpls traffic-eng level-2
net 49.0020.0200.2002.00
is-type level-2-only
metric-style wide
log-adjacency-changes

R2#sh run | s interface
interface Loopback0
ip address 2.2.2.2 255.255.255.255
ip router isis
interface Ethernet0/0
no ip address
shutdown
duplex auto
interface GigabitEthernet0/0
ip address 23.1.1.2 255.255.255.0

ip router isis
duplex full
speed 1000
media-type gbic
negotiation auto
mpls traffic-eng tunnels
mpls ip
ip rsvp bandwidth 100000
interface FastEthernet1/0
ip address 12.1.1.2 255.255.255.0
ip router isis
duplex auto
speed auto
mpls traffic-eng tunnels
mpls ip
ip rsvp bandwidth 30000
interface FastEthernet1/1
ip address 24.1.1.2 255.255.255.0
ip router isis
duplex auto
speed auto
mpls traffic-eng tunnels
mpls ip
ip rsvp bandwidth 30000
interface FastEthernet2/0
ip address 25.1.1.2 255.255.255.0
ip router isis
duplex auto
speed auto
mpls traffic-eng tunnels
mpls ip
ip rsvp bandwidth 30000

接下來就是配置tunnel 既定義一條LSP,直接貼配置解釋。兩個註意點,LSP是單向的,基於源於目的同時進行流量工程的隧道。

R1#sh run int tu 0
Building configuration...

Current configuration : 230 bytes
!
interface Tunnel0
ip unnumbered Loopback0 //由於是點到點隧道,ip地址沒有意義.

tunnel mode mpls traffic-eng // 在隧道下面使用這條命令,畢竟tunnel可以 有GRE, mGRE, ipv4各種奇奇怪怪的tunnel
tunnel destination 6.6.6.6 //指定目的地

tunnel mpls traffic-eng autoroute announce // 將流量引入隧道的其中一種方式,autoroute annouce 也是最常用的一種方式。
tunnel mpls traffic-eng path-option 1 explicit name CCIE //這個配置我指定 了所有explicit path的節點

no routing dynamic
end

顯示路徑
R1#sh run | s ip explicit
ip explicit-path name CCIE enable
next-address 12.1.1.2
next-address 25.1.1.5
next-address 45.1.1.4
next-address 34.1.1.3
next-address 36.1.1.6

有點亂,截圖把tunnel0和顯示路徑的配置貼下來
技術分享圖片

一些show 命令和排錯思路,IGP鄰居肯定得起來,由於RSVP-TE是軟狀態協議,RSVP的鄰居也得查看。
show isis neighbor
show ip rsvp neighbor

R2#show ip rsvp neighbor
Neighbor Encapsulation Time since msg rcvd/sent
12.1.1.1 Raw IP 00:00:07 00:00:04
25.1.1.5 Raw IP 00:00:20 00:00:37

  • Neighbors inactive for more than one hour are not shown.
    Use the "inactive" keyword to display them.

show mpls traffic-eng tunnels
show mpls traffic-eng tunnels tunnel 0

我截取了R2 show mpls traffic-eng tunnels的結果,可以看到進出的標簽,由於我在每個路由器上開啟了mpls label range,可以清晰明白這個標簽是哪臺路由器發放的。

R2#show mpls traffic-eng tunnels

LSP Tunnel R1_t0 is signalled, connection is up
InLabel : FastEthernet1/0, 207
OutLabel : FastEthernet2/0, 511

RSVP Signalling Info:
Src 1.1.1.1, Dst 6.6.6.6, Tun_Id 0, Tun_Instance 15
RSVP Path Info:
My Address: 25.1.1.2
Explicit Route: 25.1.1.5 45.1.1.5 45.1.1.4 34.1.1.4
34.1.1.3 36.1.1.3 36.1.1.6 6.6.6.6
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
技術分享圖片

簡單的一個抓包,可以看到tunnel是單向的,回來的icmp reply並沒有標簽。
分析下數據層面,
R1#show ip cef 6.6.6.6
6.6.6.6/32
nexthop 6.6.6.6 Tunnel0
R1#show mpls traffic-eng tunnel tun 0

Name: R1_t0 (Tunnel0) Destination: 6.6.6.6
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 1, type explicit CCIE (Basis for Setup, path weight 50)

Config Parameters:
Bandwidth: 0 kbps (Global) Priority: 7 7 Affinity: 0x0/0xFFFF
Metric Type: TE (default)
AutoRoute: enabled LockDown: disabled Loadshare: 0 bw-based
auto-bw: disabled
Active Path Option Parameters:
State: explicit path option 1 is active
BandwidthOverride: disabled LockDown: disabled Verbatim: disabled

InLabel : -
OutLabel : FastEthernet1/0, 207 //註意標簽
RSVP Signalling Info:
Src 1.1.1.1, Dst 6.6.6.6, Tun_Id 0, Tun_Instance 15
RSVP Path Info:
My Address: 12.1.1.1
Explicit Route: 12.1.1.2 25.1.1.2 25.1.1.5 45.1.1.5
45.1.1.4 34.1.1.4 34.1.1.3 36.1.1.3
36.1.1.6 6.6.6.6
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: 30 (TE)
Explicit Route: 12.1.1.1 12.1.1.2 23.1.1.2 23.1.1.3
36.1.1.3 36.1.1.6 6.6.6.6
History:
Tunnel:
Time since created: 1 hours, 33 minutes
Time since path change: 1 hours, 32 minutes
Number of LSP IDs (Tun_Instances) used: 15
Current LSP:
Uptime: 1 hours, 32 minutes
R1#

接下來就是一層層swap label的動作了。不再演示了。

MPLS TE基礎配置