配置静态MPLS TE隧道示例
配置思路
采用如下的思路配置静态MPLS TE隧道:
配置各节点接口的IP地址,并使用OSPF协议实现各节点之间公网路由可达。
配置LSR ID并全局使能各节点以及接口的MPLS、MPLS TE功能。
在入节点创建隧道接口,指定使用静态CR-LSP建立MPLS TE隧道。
配置与隧道相关联的静态CR-LSP,在入节点上配置下一跳地址和出标签,在中间节点配置入接口、入标签、下一跳地址和出标签,在出节点上配置入标签和入接口。
每个节点出标签的值就是其下一个节点入标签的值。
执行命令static-cr-lsp ingress { tunnel-interface tunnel interface-number | tunnel-name } destination destination-address { nexthop next-hop-address | outgoing-interface interface-type interface-number } * out-label out-label配置CR-LSP入节点时需注意,参数tunnel-name必须与命令interface tunnel interface-number创建的隧道接口名称一致,且区分大小写,不支持空格。假设使用命令interface tunnel 0/0/1创建了一个的Tunnel接口,则隧道接口名称为Tunnel0/0/1,其静态CR-LSP入节点中的参数应该写作“Tunnel0/0/1”,否则隧道将不能正确建立。中间节点和出节点无此限制。
操作步骤
- 配置各接口的IP地址及路由协议
# 配置LSRA。LSRB和LSRC的配置与LSRA类似,不再赘述。
<Huawei> system-view [Huawei] sysname LSRA [LSRA] interface gigabitethernet 1/0/0 [LSRA-GigabitEthernet1/0/0] ip address 172.1.1.1 255.255.255.0 [LSRA-GigabitEthernet1/0/0] quit [LSRA] interface loopback 1 [LSRA-LoopBack1] ip address 1.1.1.9 255.255.255.255 [LSRA-LoopBack1] quit [LSRA] ospf 1 [LSRA-ospf-1] area 0 [LSRA-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0 [LSRA-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255 [LSRA-ospf-1-area-0.0.0.0] quit [LSRA-ospf-1] quit
完成此步骤后,LSRA、LSRB、LSRC之间应能建立OSPF邻居关系,执行display ospf peer命令可以看到邻居状态为Full。执行display ip routing-table命令可以看到LSR之间学习到对方的Loopback1路由。
- 配置MPLS基本能力,使能MPLS TE
# 配置LSRA。LSRB和LSRC的配置与LSRA类似,不再赘述。
[LSRA] mpls lsr-id 1.1.1.9 [LSRA] mpls [LSRA-mpls] mpls te [LSRA-mpls] quit [LSRA] interface gigabitethernet 1/0/0 [LSRA-GigabitEthernet1/0/0] mpls [LSRA-GigabitEthernet1/0/0] mpls te [LSRA-GigabitEthernet1/0/0] quit
- 配置MPLS TE隧道接口
# 在LSRA上配置MPLS TE隧道接口。
[LSRA] interface tunnel 0/0/1 [LSRA-Tunnel0/0/1] ip address unnumbered interface loopback 1 [LSRA-Tunnel0/0/1] tunnel-protocol mpls te [LSRA-Tunnel0/0/1] destination 3.3.3.9 [LSRA-Tunnel0/0/1] mpls te tunnel-id 100 [LSRA-Tunnel0/0/1] mpls te signal-protocol cr-static [LSRA-Tunnel0/0/1] mpls te commit [LSRA-Tunnel0/0/1] quit
# 在LSRC上配置MPLS TE隧道。
[LSRC] interface tunnel 0/0/1 [LSRC-Tunnel0/0/1] ip address unnumbered interface loopback 1 [LSRC-Tunnel0/0/1] tunnel-protocol mpls te [LSRC-Tunnel0/0/1] destination 1.1.1.9 [LSRC-Tunnel0/0/1] mpls te tunnel-id 200 [LSRC-Tunnel0/0/1] mpls te signal-protocol cr-static [LSRC-Tunnel0/0/1] mpls te commit [LSRC-Tunnel0/0/1] quit
- 创建LSRA至LSRC的静态CR-LSP
# 配置LSRA为静态CR-LSP的入节点。
[LSRA] static-cr-lsp ingress tunnel-interface Tunnel0/0/1 destination 3.3.3.9 nexthop 172.1.1.2 out-label 20
# 配置LSRB为静态CR-LSP的中间节点。
[LSRB] static-cr-lsp transit LSRA2LSRC incoming-interface gigabitethernet 1/0/0 in-label 20 nexthop 172.2.1.2 out-label 30
# 配置LSRC为静态CR-LSP的出节点。
[LSRC] static-cr-lsp egress LSRA2LSRC incoming-interface gigabitethernet 1/0/0 in-label 30
- 创建LSRC至LSRA的静态CR-LSP
# 配置LSRC为静态CR-LSP的入节点。
[LSRC] static-cr-lsp ingress tunnel-interface Tunnel0/0/1 destination 1.1.1.9 nexthop 172.2.1.1 out-label 120
# 配置LSRB为静态CR-LSP的中间节点。
[LSRB] static-cr-lsp transit LSRC2LSRA incoming-interface gigabitethernet 2/0/0 in-label 120 nexthop 172.1.1.1 out-label 130
# 配置LSRA为静态CR-LSP的出节点。
[LSRA] static-cr-lsp egress LSRC2LSRA incoming-interface gigabitethernet 1/0/0 in-label 130
- 验证配置结果
# 配置完成后,在LSRA上执行display interface tunnel命令,可以看到Tunnel接口的状态为Up。
# 以LSRA为例:
[LSRA] display interface tunnel 0/0/1 Tunnel0/0/1 current state : UP Line protocol current state : UP ...
# 在各节点上执行display mpls te tunnel命令,可以看到MPLS TE隧道的建立情况。
# 以LSRA为例:
[LSRA] display mpls te tunnel ------------------------------------------------------------------------------ Ingress LsrId Destination LSPID In/Out Label R Tunnel-name ------------------------------------------------------------------------------ 1.1.1.9 3.3.3.9 1 --/20 I Tunnel0/0/1 - - - 130/-- E LSRC2LSRA
# 在各节点上执行display mpls lsp或display mpls static-cr-lsp命令,可以看到静态CR-LSP的建立情况。
# 以LSRA为例:
[LSRA] display mpls lsp ---------------------------------------------------------------------- LSP Information: STATIC CRLSP ---------------------------------------------------------------------- FEC In/Out Label In/Out IF Vrf Name 3.3.3.9/32 NULL/20 -/GE1/0/0 -/- 130/NULL GE1/0/0/- [LSRA] display mpls static-cr-lsp TOTAL : 2 STATIC CRLSP(S) UP : 2 STATIC CRLSP(S) DOWN : 0 STATIC CRLSP(S) Name FEC I/O Label I/O If Status Tunnel0/0/1 3.3.3.9/32 NULL/20 -/GE1/0/0 Up LSRC2LSRA -/- 130/NULL GE1/0/0/- Up
# 建立静态MPLS TE隧道时,Transit节点和Egress节点直接根据配置的入标签和出标签进行转发,因此LSRB和LSRC的相关显示信息中,FEC等内容为空。
配置文件
LSRA的配置文件
# sysname LSRA # mpls lsr-id 1.1.1.9 mpls mpls te # interface GigabitEthernet1/0/0 ip address 172.1.1.1 255.255.255.0 mpls mpls te # interface LoopBack1 ip address 1.1.1.9 255.255.255.255 # interface Tunnel0/0/1 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 3.3.3.9 mpls te signal-protocol cr-static mpls te tunnel-id 100 mpls te commit # ospf 1 area 0.0.0.0 network 1.1.1.9 0.0.0.0 network 172.1.1.0 0.0.0.255 # static-cr-lsp ingress tunnel-interface Tunnel0/0/1 destination 3.3.3.9 nexthop 172.1.1.2 out-label 20 static-cr-lsp egress LSRC2LSRA incoming-interface GigabitEthernet1/0/0 in-label 130 # return
LSRB的配置文件
# sysname LSRB # mpls lsr-id 2.2.2.9 mpls mpls te # interface GigabitEthernet1/0/0 ip address 172.1.1.2 255.255.255.0 mpls mpls te # interface GigabitEthernet2/0/0 ip address 172.2.1.1 255.255.255.0 mpls mpls te # interface LoopBack1 ip address 2.2.2.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 2.2.2.9 0.0.0.0 network 172.1.1.0 0.0.0.255 network 172.2.1.0 0.0.0.255 # static-cr-lsp transit LSRA2LSRC incoming-interface GigabitEthernet1/0/0 in-label 20 nexthop 172.2.1.2 out-label 30 static-cr-lsp transit LSRC2LSRA incoming-interface GigabitEthernet2/0/0 in-label 120 nexthop 172.1.1.1 out-label 130 # return
LSRC的配置文件
# sysname LSRC # mpls lsr-id 3.3.3.9 mpls mpls te # interface GigabitEthernet1/0/0 ip address 172.2.1.2 255.255.255.0 mpls mpls te # interface LoopBack1 ip address 3.3.3.9 255.255.255.255 # interface Tunnel0/0/1 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 1.1.1.9 mpls te signal-protocol cr-static mpls te tunnel-id 200 mpls te commit # ospf 1 area 0.0.0.0 network 3.3.3.9 0.0.0.0 network 172.2.1.0 0.0.0.255 # static-cr-lsp ingress tunnel-interface Tunnel0/0/1 destination 1.1.1.9 nexthop 172.2.1.1 out-label 120 static-cr-lsp egress LSRA2LSRC incoming-interface GigabitEthernet1/0/0 in-label 30 # return