Cisco三层×××流量导入TE隧道转发
Maa nj 2007-12-31
『一点祝福』
2007年终于走到了最后一天,在这以前,从没想到过本身会只身来到南京,来到这个陌生的异地,或许因缘际会吧,只为认识你,或许有一天本身终将离开,或许这一天会很快,可是在之后本身全部的日子里,我都会默默的为你祝福,获得属于本身的幸福。
最近作了一个MPLS网络的项目,其中一些总结,想写出来分享一下。
该网络的核心部署MPLS TE和三层×××,其中三层×××的私网流量经过MPLS TE隧道进行转发,因为MPLS TE隧道具备资源预留和带宽保证等优点,可以为私网流量转发提供比较好的质量保证,经过TE隧道支持FRR快速重路由切换,当核心网络链路或者节点失效发生时,经过TE FRR切换,能够达到50ms级的流量快速倒换,最大限度的保证核心网络的流量转发。
正由于如此,才由MPLS TE隧道代替了日常三层×××中的LDP,做为私网流量在公网转发的通道,因此在整个核心网络的部署中,是不须要部署LDP的。三层×××的配置和TE的基本配置都很广泛了,所以不是要提到的重点,本文要提的重点,是私网流量引入TE隧道的方式以及对该方式的理解。
如图所示,R1、R2和R3上均部署MPLS TE,R1和R3做为PE设备部署三层×××,IGP路由协议采用OSPF。在部署好以后,咱们能够在两个PE上看到对应的私网路由信息,以下:
R1#show ip route vrf ***1
Routing Table: ***1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
OSPF
,
IA
- OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
13.0.0
.0/24 is subnetted, 1 subnets
C
13.1.2
.0 is directly connected, Ethernet4/7
31.0.0.0/24 is subnetted, 1 subnets
B 31.1.2.0 [200/0] via 202.1.1.3, 01:54:45
R3#show ip route vrf ***1
Routing Table: ***1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
OSPF
,
IA
- OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
13.0.0
.0/24 is subnetted, 1 subnets
B
13.1.2
.0 [200/0] via 202.1.1.1, 01:56:41
31.0.0.0/24 is subnetted, 1 subnets
C 31.1.2.0 is directly connected, Ethernet4/7
R3#
能够看出这时私网路由都指向了对端PE的BGP建链的loopback地址,可是只是有了私网路由,在转发层面上仍是不可能通的,由于这个时候私网标签是不能指导公网转发的,可是又必须保证私网标签在到达对端PE以前不会被错误的剥掉,这时就须要公网标签封装在私网标签以外,完成在公网这一段的数据报文转发,之前是LDP的标签,那么如今没有LDP,天然就是TE的标签了,其实这个时候,回想一下,私网流量的转发原理无非就是如此了,无论你外层须要嵌套多少层标签,也只是为了保证BGP分配的私网标签可以正确的被携带到对端PE。
那么这个时候,须要作的只是在两端PE上配置一条到对端PE BGP创建地址的静态路由指向TE隧道。为何这样作呢,让我再连贯起来讲上一下就清楚了。好比,我在R1上查看到R3上私网地址31.1.2.0/24的路由下一跳是指向202.1.1.3的,这个时候给数据封装一层私网标签;可是202.1.1.3这个地址并非R1的地址,会继续查路由表,查到下一跳为TE隧道,而该TE隧道是本地的直链接口,因而再封装一层TE隧道的出标签做为公网标签进行转发。这里实际上是一个路由迭代的问题,在迭代的过程当中也肯定了内层标签和外层标签的位置,而这个时候有了公网标签,私网流量天然也能经过TE隧道进行转发了。
在本文中,配置静态路由就是一种将私网流量引入TE隧道转发的方式;一样的,若是TE隧道支持自动路由,那么经过自动路由的方式也是能够将私网流量引入TE隧道转发的。其实,不管是静态路由仍是自动路由,其本质是将BGP的建链地址发布到路由表中,而后经过路由迭代将私网流量引进隧道。
可是这样的方式,目前看来只是一个实现,由于这样仍是有很大局限的,由于全部不一样的×××都会经过同一个TE隧道进行转发,同一隧道对于全部的×××提供的都是相同的服务质量和带宽资源。还有其余的方式,好比在vrf下面指定该vrf流量选择的TE隧道,这样就能够根据不一样的×××选择不一样的TE隧道转发,还有就是根据策略路由指定不一样的×××进入合适的TE隧道等等,因为局限于目前手上的版本,所以只能作这样最简单的实现,可是这里提到这些是但愿提醒你们,不要由于个人讲述而限制了你们的思惟。
后面是我得一个简单配置,提供给有兴趣的朋友作参考。
『R1配置』
R1#show run
Building configuration...
Current configuration : 2071 bytes
!
version 12.4
!
hostname R1
!
ip vrf ***1
rd 100:1
route-target export 100:1
route-target import 100:1
!
!
mpls traffic-eng tunnels
!
interface Tunnel1
ip unnumbered Loopback1
tunnel destination 202.1.1.3
tunnel mode mpls traffic-eng
tunnel mpls traffic-eng path-option 16 dynamic
no routing dynamic
!
interface Loopback1
ip address 202.1.1.1 255.255.255.255
!
interface Ethernet4/0
ip address 80.1.2.1 255.255.255.0
duplex half
mpls traffic-eng tunnels
!
interface Ethernet4/7
ip vrf forwarding ***1
ip address
13.1.2
.1 255.255.255.0
duplex half
!
router ospf 1
mpls traffic-eng router-id Loopback1
mpls traffic-eng area 0
log-adjacency-changes
network 80.1.2.0
0.0.0
.255 area 0
network 202.1.1.1
0.0.0
.0 area 0
!
router bgp 100
no synchronization
bgp log-neighbor-changes
neighbor 202.1.1.3 remote-as 100
neighbor 202.1.1.3 update-source Loopback1
no auto-summary
!
address-family ***v4
neighbor 202.1.1.3 activate
neighbor 202.1.1.3 send-community extended
exit-address-family
!
address-family ipv4 vrf ***1
redistribute connected
no synchronization
exit-address-family
!
ip route 202.1.1.3 255.255.255.255 Tunnel1
『R2配置』
R2#show run
Building configuration...
Current configuration : 1369 bytes
!
version 12.4
!
hostname R2
!
mpls traffic-eng tunnels
!
interface Loopback1
ip address 202.1.1.2 255.255.255.255
!
interface Ethernet4/0
ip address 80.1.2.2 255.255.255.0
duplex half
mpls traffic-eng tunnels
!
interface Ethernet4/1
ip address 80.2.3.1 255.255.255.0
duplex half
mpls traffic-eng tunnels
!
router ospf 1
mpls traffic-eng router-id Loopback1
mpls traffic-eng area 0
log-adjacency-changes
network 80.1.2.0
0.0.0
.255 area 0
network 80.2.3.0
0.0.0
.255 area 0
『R3配置』
R3#show run
Building configuration...
Current configuration : 2045 bytes
!
version 12.4
!
hostname R3
!
ip vrf ***1
rd 100:1
route-target export 100:1
route-target import 100:1
!
!
mpls traffic-eng tunnels
!
interface Tunnel1
ip unnumbered Loopback1
tunnel destination 202.1.1.1
tunnel mode mpls traffic-eng
tunnel mpls traffic-eng path-option 16 dynamic
no routing dynamic
!
interface Loopback1
ip address 202.1.1.3 255.255.255.255
!
interface Ethernet4/1
ip address 80.2.3.2 255.255.255.0
duplex half
mpls traffic-eng tunnels
!
interface Ethernet4/7
ip vrf forwarding ***1
ip address 31.1.2.1 255.255.255.0
duplex half
!
router ospf 1
mpls traffic-eng router-id Loopback1
mpls traffic-eng area 0
log-adjacency-changes
network 80.2.3.0
0.0.0
.255 area 0
network 202.1.1.3
0.0.0
.0 area 0
!
router bgp 100
no synchronization
bgp log-neighbor-changes
neighbor 202.1.1.1 remote-as 100
neighbor 202.1.1.1 update-source Loopback1
no auto-summary
!
address-family ***v4
neighbor 202.1.1.1 activate
neighbor 202.1.1.1 send-community extended
exit-address-family
!
address-family ipv4 vrf ***1
redistribute connected
no synchronization
exit-address-family
!
ip route 202.1.1.1 255.255.255.255 Tunnel1
『R1上显示隧道1的出标签』
R1#show mpls traffic-eng tunnels tunnel 1
Name: R1_t1 (Tunnel1) Destination: 202.1.1.3
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 16, type dynamic (Basis for Setup, path weight 20)
Config Parameters:
Bandwidth: 0 kbps (Global) Priority: 7 7 Affinity: 0x0/0xFFFF
Metric Type: TE (default)
AutoRoute: disabled LockDown: disabled Loadshare: 0 bw-based
auto-bw: disabled
InLabel : -
OutLabel : Ethernet4/0, 16
RSVP Signalling Info:
Src 202.1.1.1, Dst 202.1.1.3, Tun_Id 1, Tun_Instance 11
RSVP Path Info:
My Address: 80.1.2.1
Explicit Route: 80.1.2.2 80.2.3.1 80.2.3.2 202.1.1.3
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: 20 (TE)
Explicit Route: 80.1.2.1 80.1.2.2 80.2.3.1 80.2.3.2
202.1.1.3
History:
Tunnel:
Time since created: 3 hours, 41 minutes
Time since path change: 3 hours, 39 minutes
Current LSP:
Uptime: 3 hours, 39 minutes
R1#
『R1上显示私网标签』
R1#show bgp ***v4 unicast vrf ***1 labels
Network Next Hop In label/Out label
Route Distinguisher: 100:1 (***1)
13.1.2
.0/24
0.0.0
.0 18/aggregate(***1)
31.1.2.0/24 202.1.1.3 nolabel/18
『两层嵌套标签』