配置静态BFD检测LDP LSP示例
组网需求
如图3-27所示,网络拓扑结构简单并且稳定,在PE1->P1->PE2上建立LDP LSP,PE2->P2->PE1为IP链路。接口自己感知故障,花费时间较长。要求对LDP LSP进行连通性检测,当LDP LSP出现故障时,PE1能够在500ms之内收到故障通告。
配置思路
配置静态BFD检测LDP LSP,可以实现此需求。
- 配置BFD功能,可以快速检测LDP LSP的连通性。
- 由于网络稳定,地址不会变更,因此配置静态BFD检测LDP LSP。为了实现这一步,需在PE1、PE2上配置BFD会话。
- 调整BFD检测参数,实现PE1能够在500ms之内收到故障通告。
操作步骤
- 配置各接口的IP地址
# 配置PE1。P1、P2和PE2的配置与PE1类似,不再赘述。
<Huawei> system-view [Huawei] sysname PE1 [PE1] interface loopback 1 [PE1-LoopBack1] ip address 10.10.1.1 32 [PE1-LoopBack1] quit [PE1] interface gigabitethernet 1/0/0 [PE1-GigabitEthernet1/0/0] ip address 10.1.1.1 24 [PE1-GigabitEthernet1/0/0] quit [PE1] interface gigabitethernet 2/0/0 [PE1-GigabitEthernet2/0/0] ip address 10.3.1.1 24 [PE1-GigabitEthernet2/0/0] quit
- 配置OSPF协议发布各节点接口所连网段和LSR ID的主机路由
# 配置PE1。P1、P2和PE2的配置与PE1类似,不再赘述。
[PE1] ospf 1 [PE1-ospf-1] area 0 [PE1-ospf-1-area-0.0.0.0] network 10.10.1.1 0.0.0.0 [PE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255 [PE1-ospf-1-area-0.0.0.0] network 10.3.1.0 0.0.0.255 [PE1-ospf-1-area-0.0.0.0] quit [PE1-ospf-1] quit
- 在PE1->P1->PE2上建立LDP LSP
# 配置PE1。
[PE1] mpls lsr-id 10.10.1.1 [PE1] mpls [PE1-mpls] quit [PE1] mpls ldp [PE1-mpls-ldp] quit [PE1] interface gigabitethernet 1/0/0 [PE1-GigabitEthernet1/0/0] mpls [PE1-GigabitEthernet1/0/0] mpls ldp [PE1-GigabitEthernet1/0/0] quit
# 配置P1。
[P1] mpls lsr-id 10.10.1.2 [P1] mpls [P1-mpls] quit [P1] mpls ldp [P1-mpls-ldp] quit [P1] interface gigabitethernet 1/0/0 [P1-GigabitEthernet1/0/0] mpls [P1-GigabitEthernet1/0/0] mpls ldp [P1-GigabitEthernet1/0/0] quit [P1] interface gigabitethernet 2/0/0 [P1-GigabitEthernet2/0/0] mpls [P1-GigabitEthernet2/0/0] mpls ldp [P1-GigabitEthernet2/0/0] quit
# 配置PE2。
[PE2] mpls lsr-id 10.10.1.4 [PE2] mpls [PE2-mpls] quit [PE2] mpls ldp [PE2-mpls-ldp] quit [PE2] interface gigabitethernet 1/0/0 [PE2-GigabitEthernet1/0/0] mpls [PE2-GigabitEthernet1/0/0] mpls ldp [PE2-GigabitEthernet1/0/0] quit
# 执行命令display mpls ldp lsp,可以看到在PE1上建立了到目的地址为10.10.1.4/32的LDP LSP。
[PE1] display mpls ldp lsp LDP LSP Information ------------------------------------------------------------------------------- DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface ------------------------------------------------------------------------------- 10.10.1.1/32 3/NULL 10.10.1.2 127.0.0.1 InLoop0 *10.10.1.1/32 Liberal/3 DS/10.10.1.2 10.10.1.2/32 NULL/3 - 10.1.1.2 GE1/0/0 10.10.1.2/32 1024/3 10.10.1.2 10.1.1.2 GE1/0/0 10.10.1.4/32 NULL/1025 - 10.1.1.2 GE1/0/0 10.10.1.4/32 1022/1025 10.10.1.2 10.1.1.2 GE1/0/0 ------------------------------------------------------------------------------- TOTAL: 5 Normal LSP(s) Found. TOTAL: 1 Liberal LSP(s) Found. TOTAL: 0 Frr LSP(s) Found. A '*' before an LSP means the LSP is not established A '*' before a Label means the USCB or DSCB is stale A '*' before a UpstreamPeer means the session is stale A '*' before a DS means the session is stale A '*' before a NextHop means the LSP is FRR LSP
- 在被检测链路两端节点上使能全局BFD能力
# 配置PE1。
[PE1] bfd [PE1-bfd] quit
# 配置PE2。
[PE2] bfd [PE2-bfd] quit
- 在Ingress上配置绑定到LDP LSP的BFD会话,发送报文的最小时间间隔是100毫秒,接收报文的最小时间间隔是100毫秒,并且能够修改端口状态表
# 配置PE1。
[PE1] bfd pe1tope2 bind ldp-lsp peer-ip 10.10.1.4 nexthop 10.1.1.2 interface gigabitethernet 1/0/0 [PE1-bfd-lsp-session-pe1tope2] discriminator local 1 [PE1-bfd-lsp-session-pe1tope2] discriminator remote 2 [PE1-bfd-lsp-session-pe1tope2] min-tx-interval 100 [PE1-bfd-lsp-session-pe1tope2] min-rx-interval 100 [PE1-bfd-lsp-session-pe1tope2] process-pst [PE1-bfd-lsp-session-pe1tope2] commit [PE1-bfd-lsp-session-pe1tope2] quit
- 在Egress上配置绑定到IP链路的BFD会话,用来将LDP LSP的故障通告给Ingress
# 配置PE2。
[PE2] bfd pe2tope1 bind peer-ip 10.10.1.1 [PE2-bfd-session-pe2tope1] discriminator local 2 [PE2-bfd-session-pe2tope1] discriminator remote 1 [PE2-bfd-session-pe2tope1] min-tx-interval 100 [PE2-bfd-session-pe2tope1] min-rx-interval 100 [PE2-bfd-session-pe2tope1] commit [PE2-bfd-session-pe2tope1] quit
- 验证配置结果
# 配置完成后,在Ingress上执行命令display bfd session all,可以看到“State”字段的值为“Up”。
[PE1] display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 1 2 10.10.1.4 Up S_LDP_LSP GigabitEthernet1/0/0 -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
# 在Egress上执行命令display bfd session all,可以看到“State”字段的值为“Up”。
[PE2] display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 2 1 10.10.1.1 Up S_IP_PEER - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
配置文件
PE1的配置文件
# sysname PE1 # bfd # mpls lsr-id 10.10.1.1 mpls # mpls ldp # interface GigabitEthernet1/0/0 ip address 10.1.1.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 ip address 10.3.1.1 255.255.255.0 # interface LoopBack1 ip address 10.10.1.1 255.255.255.255 # bfd pe1tope2 bind ldp-lsp peer-ip 10.10.1.4 nexthop 10.1.1.2 interface GigabitEthernet1/0/0 discriminator local 1 discriminator remote 2 min-tx-interval 100 min-rx-interval 100 process-pst commit # ospf 1 area 0.0.0.0 network 10.10.1.1 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.3.1.0 0.0.0.255 # return
P1的配置文件
# sysname P1 # mpls lsr-id 10.10.1.2 mpls # mpls ldp # interface GigabitEthernet1/0/0 ip address 10.1.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 ip address 10.2.1.1 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 10.10.1.2 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.2 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.2.1.0 0.0.0.255 # return
P2的配置文件
# sysname P2 # interface GigabitEthernet1/0/0 ip address 10.3.1.2 255.255.255.0 # interface GigabitEthernet2/0/0 ip address 10.4.1.1 255.255.255.0 # interface LoopBack1 ip address 10.10.1.3 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.3 0.0.0.0 network 10.3.1.0 0.0.0.255 network 10.4.1.0 0.0.0.255 # return
PE2的配置文件
# sysname PE2 # bfd # mpls lsr-id 10.10.1.4 mpls # mpls ldp # interface GigabitEthernet1/0/0 ip address 10.2.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 ip address 10.4.1.2 255.255.255.0 # interface LoopBack1 ip address 10.10.1.4 255.255.255.255 # bfd pe2tope1 bind peer-ip 10.10.1.1 discriminator local 2 discriminator remote 1 min-tx-interval 100 min-rx-interval 100 commit # ospf 1 area 0.0.0.0 network 10.10.1.4 0.0.0.0 network 10.2.1.0 0.0.0.255 network 10.4.1.0 0.0.0.255 # return