懒惰真是万恶之源,过年到现在就挤了这么一篇,不过学习嘛,一步步来。
这篇讲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
一些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的动作了。不再演示了。