配置VPN FRR示例
在CE多归属环境中,配置VPN FRR可以保证PE设备发生故障时实现VPN业务的快速切换。
配置注意事项
在配置过程中,需注意以下事项:
CE双归属到PE上配置不同RD的VPN实例。
- VPN FRR场景,主路径故障恢复后,会进行路径回切。在这个过程中,可能由于各个节点IGP收敛时序不同,造成回切丢包。为了解决这个问题,需要执行route-select delay delay-value命令,配置选路延迟功能,保证在主路径设备上的转发表项刷新稳定后再进行回切。具体的回切延迟时间delay-value与设备上实际路由数量等因素有关,用户需要根据实际情况合理配置。
配置思路
采用如下思路配置VPN FRR功能。
在MPLS骨干网上(PE1、PE2和PE3)配置OSPF,实现骨干网互通。
在MPLS骨干网上配置MPLS基本能力,使能MPLS LDP,建立LDP LSP。
分别在各PE设备(PE1、PE2和PE3)上配置VPN实例,将CE1接入PE2和PE3。
在各PE与CE1之间建立EBGP对等体,引入VPN路由;在PE1与PE2、PE1与PE3之间建立MP-IBGP对等体。
在PE1、PE2和PE3上配置动态BFD检测LDP Tunnel。
在PE1上使能BGP Auto FRR。
操作步骤
- 配置VPN骨干网和VPN site中各接口的IP地址(略)
- 在MPLS骨干网上配置OSPF协议,实现骨干网PE互通(略)
- 在MPLS骨干网上配置MPLS基本能力和MPLS LDP,建立LDP LSP
# 配置PE1。
<PE1> system-view
[~PE1] mpls lsr-id 1.1.1.1
[*PE1] mpls
[*PE1-mpls] quit
[*PE1] mpls ldp
[*PE1-mpls-ldp] quit
[*PE1] interface gigabitethernet2/0/0
[*PE1-GigabitEthernet2/0/0] mpls
[*PE1-GigabitEthernet2/0/0] mpls ldp
[*PE1-GigabitEthernet2/0/0] commit
[*PE1-GigabitEthernet2/0/0] quit
[*PE1] interface gigabitethernet3/0/0
[*PE1-GigabitEthernet3/0/0] mpls
[*PE1-GigabitEthernet3/0/0] mpls ldp
[*PE1-GigabitEthernet3/0/0] commit
[~PE1-GigabitEthernet3/0/0] quit
# 配置PE2。
<PE2> system-view
[~PE2] mpls lsr-id 2.2.2.2
[*PE2] mpls
[*PE2-mpls] quit
[*PE2] mpls ldp
[*PE2-mpls-ldp] quit
[*PE2] interface gigabitethernet1/0/0
[*PE2-GigabitEthernet1/0/0] mpls
[*PE2-GigabitEthernet1/0/0] mpls ldp
[*PE2-GigabitEthernet1/0/0] commit
[~PE2-GigabitEthernet1/0/0] quit
# 配置PE3。
<PE3> system-view
[~PE3] mpls lsr-id 3.3.3.3
[*PE3] mpls
[*PE3-mpls] quit
[*PE3] mpls ldp
[*PE3-mpls-ldp] quit
[*PE3] interface gigabitethernet1/0/0
[*PE3-GigabitEthernet1/0/0] mpls
[*PE3-GigabitEthernet1/0/0] mpls ldp
[*PE3-GigabitEthernet1/0/0] commit
[~PE3-GigabitEthernet1/0/0] quit
此时在PE上执行命令display mpls lsp,可看到PE1与PE2、PE1与PE3之间的LSP建立成功。以PE1的显示为例:
<PE1> display mpls lsp
------------------------------------------------------------------------------- LSP Information: LDP LSP ------------------------------------------------------------------------------- FEC In/Out Label In/Out IF Vrf Name 1.1.1.1/32 3/NULL -/- 2.2.2.2/32 NULL/3 -/GE2/0/0 2.2.2.2/32 4096/3 -/GE2/0/0 3.3.3.3/32 NULL/3 -/GE3/0/0 3.3.3.3/32 4097/3 -/GE3/0/0
- 在PE设备上配置VPN实例,将CE接入PE2和PE3
# 配置PE1。
[~PE1] ip vpn-instance vpn1
[*PE1-vpn-instance-vpn1] ipv4-family
[*PE1-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:1
[*PE1-vpn-instance-vpn1-af-ipv4] vpn-target 111:1
[*PE1-vpn-instance-vpn1-af-ipv4] quit
[*PE1-vpn-instance-vpn1] quit
[*PE1] commit
# 配置PE2。
[*PE2] ip vpn-instance vpn1
[*PE2-vpn-instance-vpn1] ipv4-family
[*PE2-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:2
[*PE2-vpn-instance-vpn1-af-ipv4] vpn-target 111:1
[*PE2-vpn-instance-vpn1-af-ipv4] quit
[*PE2-vpn-instance-vpn1] quit
[*PE2] interface gigabitethernet2/0/0
[*PE2-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[*PE2-GigabitEthernet2/0/0] ip address 10.1.1.2 30
[*PE2-GigabitEthernet2/0/0] quit
[*PE2] commit
# 配置PE3。
[~PE3] ip vpn-instance vpn1
[*PE3-vpn-instance-vpn1] ipv4-family
[*PE3-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:3
[*PE3-vpn-instance-vpn1-af-ipv4] vpn-target 111:1
[*PE3-vpn-instance-vpn1-af-ipv4] quit
[*PE3-vpn-instance-vpn1] quit
[*PE3] interface gigabitethernet2/0/0
[*PE3-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[*PE3-GigabitEthernet2/0/0] ip address 10.2.1.2 30
[*PE3-GigabitEthernet2/0/0] commit
[~PE3-GigabitEthernet2/0/0] quit
- PE2与CE,及PE3与CE之间建立EBGP对等体,并引入CE上的Loopback路由
# 配置PE2。
[~PE2] bgp 100
[*PE2-bgp] ipv4-family vpn-instance vpn1
[*PE2-bgp-vpn1] peer 10.1.1.1 as-number 65410
[*PE2-bgp-vpn1] commit
[*PE2-bgp-vpn1] quit
# 配置PE3。
[*PE3] bgp 100
[*PE3-bgp] ipv4-family vpn-instance vpn1
[*PE3-bgp-vpn1] peer 10.2.1.1 as-number 65410
[*PE3-bgp-vpn1] commit
[*PE3-bgp-vpn1] quit
# 配置CE。
[*CE] interface loopback 1
[*CE-Loopback1] ip address 11.11.11.11 32
[*CE-Loopback1] quit
[*CE] bgp 65410
[*CE-bgp] peer 10.1.1.2 as-number 100
[*CE-bgp] peer 10.2.1.2 as-number 100
[*CE-bgp] network 11.11.11.11 32
[*CE-bgp] quit
[*CE] commit
# 配置PE1。
[*PE1] bgp 100
[*PE1-bgp] ipv4-family vpn-instance vpn1
[*PE1-bgp-vpn1] commit
[~PE1-bgp-vpn1] quit
完成此步骤后,在PE2和PE3上执行display bgp vpnv4 vpn-instance peer命令,可看到PE和CE之间的EBGP对等体建立成功,其状态为“Established”。
以PE2的显示为例:
<PE2> display bgp vpnv4 vpn-instance vpn1 peer
BGP local router ID : 10.10.1.2 Local AS number : 100 VPN-Instance vpn1, Router ID 10.10.1.2: Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 10.1.1.1 4 65410 29 28 0 00:22:20 Established 1
- 在PE之间建立MP-IBGP对等体
# 配置PE1。
[~PE1] bgp 100
[~PE1-bgp] peer 2.2.2.2 as-number 100
[*PE1-bgp] peer 2.2.2.2 connect-interface loopback 1
[*PE1-bgp] peer 3.3.3.3 as-number 100
[*PE1-bgp] peer 3.3.3.3 connect-interface loopback 1
[*PE1-bgp] ipv4-family vpnv4
[*PE1-bgp-af-vpnv4] peer 2.2.2.2 enable
[*PE1-bgp-af-vpnv4] peer 3.3.3.3 enable
[*PE1-bgp-af-vpnv4] commit
[~PE1-bgp-af-vpnv4] quit
# 配置PE2。
[~PE2] bgp 100
[~PE2-bgp] peer 1.1.1.1 as-number 100
[*PE2-bgp] peer 1.1.1.1 connect-interface loopback 1
[*PE2-bgp] ipv4-family vpnv4
[*PE2-bgp-af-vpnv4] peer 1.1.1.1 enable
[*PE2-bgp-af-vpnv4] commit
[~PE2-bgp-af-vpnv4] quit
# 配置PE3。
[~PE3] bgp 100
[~PE3-bgp] peer 1.1.1.1 as-number 100
[*PE3-bgp] peer 1.1.1.1 connect-interface loopback 1
[*PE3-bgp] ipv4-family vpnv4
[*PE3-bgp-af-vpnv4] peer 1.1.1.1 enable
[*PE3-bgp-af-vpnv4] commit
[~PE3-bgp-af-vpnv4] quit
完成此步骤后,在PE上执行display bgp vpnv4 all peer命令,可看到MP-IBGP对等体建立成功,其状态为“Established”。
以PE1的显示为例:
<PE1> display bgp vpnv4 all peer
BGP local router ID : 1.1.1.1 Local AS number : 100 Total number of peers : 2 Peers in established state : 2 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 2.2.2.2 4 100 43 30 0 00:21:55 Established 1 3.3.3.3 4 100 36 25 0 00:18:12 Established 1
- 配置动态BFD检测LDP Tunnel
# 在PE1上配置动态BFD检测LDP Tunnel
[~PE1] bfd
[*PE1-bfd] quit
[*PE1] mpls
[*PE1-mpls] mpls bfd enable
[*PE1-mpls] mpls bfd-trigger-tunnel host
[*PE1-mpls] quit
[*PE1] commit
# 在PE2上配置动态BFD检测LDP Tunnel
[~PE2] bfd
[*PE2-bfd] mpls-passive
[*PE2-bfd] quit
[*PE2] commit
# 在PE3上配置动态BFD检测LDP Tunnel
[~PE3] bfd
[*PE3-bfd] mpls-passive
[*PE3-bfd] quit
[*PE3] commit
# 配置完成后,在PE1和PE2上执行display bfd session all verbose命令,可以看到“State”字段的值为“Up”,且“BFD Bind Type”字段的值为“LDP_TUNNEL”。
- 使能BGP Auto FRR
[~PE1] bgp 100
[~PE1-bgp] ipv4-family vpn-instance vpn1
[*PE1-bgp-vpn1] auto-frr
[*PE1-bgp-vpn1] route-select delay 300
[*PE1-bgp-vpn1] quit
[*PE1-bgp] quit
[*PE1] commit
# 查看备份下一跳、备份标签和备份Tunnel ID的信息。
<PE1> display ip routing-table vpn-instance vpn1 11.11.11.11 verbose
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Table : vpn1 Summary Count : 1 Destination: 11.11.11.11/32 Protocol: IBGP Process ID: 0 Preference: 255 Cost: 0 NextHop: 2.2.2.2 Neighbour: 0.0.0.0 State: Active Adv Relied Age: 00h08m28s Tag: 0 Priority: low Label: 4098 QoSInfo: 0x0 IndirectID: 0x6400006D RelayNextHop: 10.10.1.2 Interface: GigabitEthernet2/0/0 TunnelID: 0x0000000001004c4b42 Flags: RD BkNextHop: 3.3.3.3 BkInterface: GigabitEthernet3/0/0 BkLabel: 4098 SecTunnelID: 0x0 BkPETunnelID: 0x0000000001004c4b43 BkPESecTunnelID: 0x0 BkIndirectID: 0x6400006F
配置文件
PE1的配置文件
# sysname PE1 # ip vpn-instance vpn1 ipv4-family route-distinguisher 100:1 apply-label per-instance vpn-target 111:1 export-extcommunity vpn-target 111:1 import-extcommunity # bfd # mpls lsr-id 1.1.1.1 # mpls mpls bfd enable mpls bfd-trigger-tunnel host # mpls ldp # interface GigabitEthernet2/0/0 undo shutdown ip address 10.10.1.1 255.255.255.252 mpls mpls ldp # interface GigabitEthernet3/0/0 undo shutdown ip address 10.20.1.1 255.255.255.252 mpls mpls ldp # interface LoopBack1 ip address 1.1.1.1 255.255.255.255 # bgp 100 peer 2.2.2.2 as-number 100 peer 2.2.2.2 connect-interface LoopBack1 peer 3.3.3.3 as-number 100 peer 3.3.3.3 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 2.2.2.2 enable peer 3.3.3.3 enable # ipv4-family vpnv4 policy vpn-target peer 2.2.2.2 enable peer 3.3.3.3 enable # ipv4-family vpn-instance vpn1 auto-frr route-select delay 300 # ospf 1 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 10.10.1.0 0.0.0.3 network 10.20.1.0 0.0.0.3 # return
PE2的配置文件
# sysname PE2 # ip vpn-instance vpn1 ipv4-family route-distinguisher 100:2 apply-label per-instance vpn-target 111:1 export-extcommunity vpn-target 111:1 import-extcommunity # bfd mpls-passive # mpls lsr-id 2.2.2.2 # mpls # mpls ldp # interface GigabitEthernet1/0/0 undo shutdown ip binding vpn-instance vpn1 ip address 10.1.1.2 255.255.255.252 # interface GigabitEthernet2/0/0 undo shutdown ip address 10.10.1.2 255.255.255.252 mpls mpls ldp # interface LoopBack1 ip address 2.2.2.2 255.255.255.255 # bgp 100 peer 1.1.1.1 as-number 100 peer 1.1.1.1 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 1.1.1.1 enable # ipv4-family vpnv4 policy vpn-target peer 1.1.1.1 enable # ipv4-family vpn-instance vpn1 peer 10.1.1.1 as-number 65410 # ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 10.10.1.0 0.0.0.3 # return
PE3的配置文件
# sysname PE3 # ip vpn-instance vpn1 ipv4-family route-distinguisher 100:3 apply-label per-instance vpn-target 111:1 export-extcommunity vpn-target 111:1 import-extcommunity # bfd mpls-passive # mpls lsr-id 3.3.3.3 # mpls # mpls ldp # interface GigabitEthernet1/0/0 undo shutdown ip address 10.20.1.2 255.255.255.252 mpls mpls ldp # interface GigabitEthernet2/0/0 undo shutdown ip binding vpn-instance vpn1 ip address 10.2.1.2 255.255.255.252 # interface LoopBack1 ip address 3.3.3.3 255.255.255.255 # bgp 100 peer 1.1.1.1 as-number 100 peer 1.1.1.1 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 1.1.1.1 enable # ipv4-family vpnv4 policy vpn-target peer 1.1.1.1 enable # ipv4-family vpn-instance vpn1 peer 10.2.1.1 as-number 65410 # ospf 1 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 10.20.1.0 0.0.0.3 # return
CE的配置文件
# sysname CE # interface GigabitEthernet1/0/0 undo shutdown ip address 10.1.1.1 255.255.255.252 # interface GigabitEthernet2/0/0 undo shutdown ip address 10.2.1.1 255.255.255.252 # interface LoopBack1 ip address 11.11.11.11 255.255.255.255 # bgp 65410 peer 10.1.1.2 as-number 100 peer 10.2.1.2 as-number 100 # ipv4-family unicast undo synchronization network 11.11.11.11 255.255.255.255 peer 10.1.1.2 enable peer 10.2.1.2 enable # return