配置VXLAN EVPN接入MPLS EVPN IRBv6的DCI场景示例
本节介绍VXLAN EVPN接入MPLS EVPN IRBv6的DCI场景的示例,该示例中数据中心网关设备通过VXLAN隧道接入DCI骨干网,DCI骨干网络上部署BGP EVPN功能来实现数据中心互连。
组网需求
如图12-83所示,数据中心网关设备GW1和GW2分别连接到骨干网络上,通过在DCI骨干网络上部署BGP EVPN功能,在GW和DCI-PE之间部署EVPN协议和VXLAN隧道来传递VM主机IPv6路由信息,实现数据中心A和数据中心B之间的互相通信(例如VMa1和VMb2之间互相通信)。
设备 |
接口 |
IP地址 |
---|---|---|
DCI-PE1 |
GigabitEthernet 1/0/0 |
192.168.20.1 |
GigabitEthernet 2/0/0 |
192.168.1.1/24 |
|
LoopBack1 |
1.1.1.1/32 |
|
LoopBack2 |
11.11.11.11/32 |
|
P |
GigabitEthernet 1/0/0 |
192.168.1.2/24 |
GigabitEthernet 2/0/0 |
192.168.10.1/24 |
|
LoopBack1 |
2.2.2.2/32 |
|
DCI-PE2 |
GigabitEthernet 1/0/0 |
192.168.30.1 |
GigabitEthernet 2/0/0 |
192.168.10.2/24 |
|
LoopBack1 |
3.3.3.3/32 |
|
LoopBack2 |
33.33.33.33/32 |
配置思路
采用如下的思路进行配置:
DCI骨干网上配置OSPF实现DCI-PE之间的互通。
DCI骨干网上配置MPLS TE隧道。
DCI-PE上配置通往GW的Loopback地址的静态路由。
配置DCI-PE上的EVPN实例与BD。
配置DCI-PE上的源地址。
DCI-PE上配置与GW、远端DCI-PE间的BGP EVPN对等体关系。
DCI-PE上配置VPN实例。
DCI-PE与GW之间配置VXLAN隧道。
配置应用隧道策略
在DCI-PE上配置路由重生成功能。
数据准备
为完成此配置例,需准备如下的数据:
DCI-PE及P上的MPLS LSR-ID。
VPN实例的RD。
VPN实例的收发路由属性VPN-Target。
EVPN实例的RD。
EVPN实例的收发路由属性VPN-Target。
操作步骤
- 配置各节点接口的IP地址及Loopback接口的地址
配置各接口的IP地址和掩码,具体配置过程请参考配置文件。
- 在DCI骨干网上配置IGP,本示例使用OSPF
具体配置过程请参考配置文件。
- 在DCI骨干网上配置TE隧道
具体配置过程请参考配置文件。
- 在DCI-PE上配置通往GW的Loopback地址的静态路由
具体配置过程请参考配置文件。
- 配置DCI-PE上的EVPN实例与BD
# 配置DCI-PE1。
[~DCI-PE1] evpn vpn-instance evrf1 bd-mode
[*DCI-PE1-evpn-instance-evrf1] route-distinguisher 10:1
[*DCI-PE1-evpn-instance-evrf1] vpn-target 11:1 both
[*DCI-PE1-evpn-instance-evrf1] quit
[*DCI-PE1] bridge-domain 10
[*DCI-PE1-bd10] vxlan vni 5010 split-horizon-mode
[*DCI-PE1-bd10] evpn binding vpn-instance evrf1
[*DCI-PE1-bd10] esi 0000.1111.1111.4444.5555
[*DCI-PE1-bd10] quit
[*DCI-PE1] interface GigabitEthernet 1/0/0.1 mode l2
[*DCI-PE1-GigabitEthernet1/0/0.1] encapsulation qinq
[*DCI-PE1-GigabitEthernet1/0/0.1] bridge-domain 10
[*DCI-PE1-GigabitEthernet1/0/0.1] quit
[*DCI-PE1] commit
# 配置DCI-PE2。
[~DCI-PE2] evpn vpn-instance evrf1 bd-mode
[*DCI-PE2-evpn-instance-evrf1] route-distinguisher 10:1
[*DCI-PE2-evpn-instance-evrf1] vpn-target 11:1 both
[*DCI-PE2-evpn-instance-evrf1] quit
[*DCI-PE2] bridge-domain 10
[*DCI-PE2-bd10] vxlan vni 5020 split-horizon-mode
[*DCI-PE2-bd10] evpn binding vpn-instance evrf1
[*DCI-PE2-bd10] esi 0000.1111.3333.4444.5555
[*DCI-PE2-bd10] quit
[*DCI-PE2] interface GigabitEthernet 1/0/0.1 mode l2
[*DCI-PE2-GigabitEthernet1/0/0.1] encapsulation qinq
[*DCI-PE2-GigabitEthernet1/0/0.1] bridge-domain 10
[*DCI-PE2-GigabitEthernet1/0/0.1] quit
[*DCI-PE2] commit
- 配置DCI-PE上的源地址。
# 配置DCI-PE1。
[~DCI-PE1] evpn source-address 1.1.1.1
[*DCI-PE1] commit
# 配置DCI-PE2。
[~DCI-PE2] evpn source-address 3.3.3.3
[*DCI-PE2] commit
- 配置DCI-PE与GW、远端DCI-PE间的BGP EVPN对等体关系
# 配置DCI-PE1。
[~DCI-PE1] bgp 100
[*DCI-PE1-bgp] peer 3.3.3.3 as-number 100
[*DCI-PE1-bgp] peer 3.3.3.3 connect-interface loopback 1
[*DCI-PE1-bgp] peer 4.4.4.4 as-number 65410
[*DCI-PE1-bgp] peer 4.4.4.4 ebgp-max-hop 255
[*DCI-PE1-bgp] peer 4.4.4.4 connect-interface loopback 1
[*DCI-PE1-bgp] l2vpn-family evpn
[*DCI-PE1-bgp-af-evpn] peer 3.3.3.3 enable
[*DCI-PE1-bgp-af-evpn] peer 4.4.4.4 enable
[*DCI-PE1-bgp-af-evpn] peer 4.4.4.4 advertise encap-type vxlan
[*DCI-PE1-bgp-af-evpn] quit
[*DCI-PE1-bgp] quit
[*DCI-PE1] commit
# 配置DCI-PE2。
[~DCI-PE2] bgp 100
[*DCI-PE2-bgp] peer 1.1.1.1 as-number 100
[*DCI-PE2-bgp] peer 1.1.1.1 connect-interface loopback 1
[*DCI-PE2-bgp] peer 5.5.5.5 as-number 65420
[*DCI-PE2-bgp] peer 5.5.5.5 ebgp-max-hop 255
[*DCI-PE2-bgp] peer 5.5.5.5 connect-interface loopback 1
[*DCI-PE2-bgp] l2vpn-family evpn
[*DCI-PE2-bgp-af-evpn] peer 1.1.1.1 enable
[*DCI-PE2-bgp-af-evpn] peer 5.5.5.5 enable
[*DCI-PE2-bgp-af-evpn] peer 5.5.5.5 advertise encap-type vxlan
[*DCI-PE2-bgp-af-evpn] quit
[*DCI-PE2-bgp] quit
[*DCI-PE2] commit
- 配置VPN实例
# 配置DCI-PE1。
[~DCI-PE1] ip vpn-instance vpn1
[*DCI-PE1-vpn-instance-vpn1] ipv6-family
[*DCI-PE1-vpn-instance-vpn1-af-ipv6] route-distinguisher 11:11
[*DCI-PE1-vpn-instance-vpn1-af-ipv6] vpn-target 11:1 both evpn
[*DCI-PE1-vpn-instance-vpn1-af-ipv6] evpn mpls routing-enable
[*DCI-PE1-vpn-instance-vpn1-af-ipv6] quit
[*DCI-PE1-vpn-instance-vpn1] vxlan vni 555
[*DCI-PE1-vpn-instance-vpn1] quit
[*DCI-PE1] interface Vbdif10
[*DCI-PE1-Vbdif10] ip binding vpn-instance vpn1
[*DCI-PE1-Vbdif10] ipv6 enable
[*DCI-PE1-Vbdif10] ipv6 address 2001:db8:10::1 64
[*DCI-PE1-Vbdif10] ipv6 nd collect host enable
[*DCI-PE1-Vbdif10] quit
[*DCI-PE1] commit
# 配置DCI-PE2。
[~DCI-PE2] ip vpn-instance vpn1
[*DCI-PE2-vpn-instance-vpn1] ipv6-family
[*DCI-PE2-vpn-instance-vpn1-af-ipv6] route-distinguisher 11:11
[*DCI-PE2-vpn-instance-vpn1-af-ipv6] vpn-target 11:1 both evpn
[*DCI-PE2-vpn-instance-vpn1-af-ipv6] evpn mpls routing-enable
[*DCI-PE2-vpn-instance-vpn1-af-ipv6] quit
[*DCI-PE2-vpn-instance-vpn1] vxlan vni 555
[*DCI-PE2-vpn-instance-vpn1] quit
[*DCI-PE2] interface Vbdif10
[*DCI-PE2-Vbdif10] ip binding vpn-instance vpn1
[*DCI-PE2-Vbdif10] ipv6 enable
[*DCI-PE2-Vbdif10] ipv6 address 2001:db8:20::1 64
[*DCI-PE2-Vbdif10] ipv6 nd collect host enable
[*DCI-PE2-Vbdif10] quit
[*DCI-PE2] commit
- DCI-PE与GW之间配置VXLAN隧道
# 配置DCI-PE1。
[~DCI-PE1] interface nve 1
[*DCI-PE1-Nve1] source 11.11.11.11
[*DCI-PE1-Nve1] quit
[*DCI-PE1] commit
# 配置DCI-PE2。
[~DCI-PE2] interface nve 1
[*DCI-PE2-Nve1] source 33.33.33.33
[*DCI-PE2-Nve1] quit
[*DCI-PE2] commit
- 配置应用隧道策略
# 配置DCI-PE1。
[~DCI-PE1] tunnel-policy te-lsp1
[*DCI-PE1-tunnel-policy-te-lsp1] tunnel select-seq cr-lsp load-balance-number 1
[*DCI-PE1-tunnel-policy-te-lsp1] quit
[*DCI-PE1] ip vpn-instance vpn1
[*DCI-PE1-vpn-instance-vpn1] ipv6-family
[*DCI-PE1-vpn-instance-vpn1-af-ipv6] tnl-policy te-lsp1 evpn
[*DCI-PE1-vpn-instance-vpn1-af-ipv6] quit
[*DCI-PE1-vpn-instance-vpn1] quit
[*DCI-PE1] evpn vpn-instance evrf1 bd-mode
[*DCI-PE1-evpn-instance-evrf1] tnl-policy te-lsp1
[*DCI-PE1-evpn-instance-evrf1] quit
[*DCI-PE1] commit
# 配置DCI-PE2。
[~DCI-PE2] tunnel-policy te-lsp1
[*DCI-PE2-tunnel-policy-te-lsp1] tunnel select-seq cr-lsp load-balance-number 1
[*DCI-PE2-tunnel-policy-te-lsp1] quit
[*DCI-PE2] ip vpn-instance vpn1
[*DCI-PE2-vpn-instance-vpn1] ipv6-family
[*DCI-PE2-vpn-instance-vpn1-af-ipv6] tnl-policy te-lsp1 evpn
[*DCI-PE2-vpn-instance-vpn1-af-ipv6] quit
[*DCI-PE2-vpn-instance-vpn1] quit
[*DCI-PE2] evpn vpn-instance evrf1 bd-mode
[*DCI-PE2-evpn-instance-evrf1] tnl-policy te-lsp1
[*DCI-PE2-evpn-instance-evrf1] quit
[*DCI-PE2] commit
- 配置向EVPN对等体发布重生成后的路由
# 配置DCI-PE1。
[~DCI-PE1] bgp 100
[*DCI-PE1-bgp] ipv6-family vpn-instance vpn1
[*DCI-PE1-bgp-6-vpn1] import-route direct
[*DCI-PE1-bgp-6-vpn1] advertise l2vpn evpn
[*DCI-PE1-bgp-6-vpn1] quit
[*DCI-PE1-bgp] l2vpn-family evpn
[*DCI-PE1-bgp-af-evpn] peer 3.3.3.3 import reoriginate
[*DCI-PE1-bgp-af-evpn] peer 3.3.3.3 advertise route-reoriginated evpn mac
[*DCI-PE1-bgp-af-evpn] peer 3.3.3.3 advertise route-reoriginated evpn mac-ipv6
[*DCI-PE1-bgp-af-evpn] peer 3.3.3.3 advertise route-reoriginated evpn ipv6
[*DCI-PE1-bgp-af-evpn] peer 3.3.3.3 advertise irbv6
[*DCI-PE1-bgp-af-evpn] peer 4.4.4.4 import reoriginate
[*DCI-PE1-bgp-af-evpn] peer 4.4.4.4 advertise route-reoriginated evpn mac-ipv6
[*DCI-PE1-bgp-af-evpn] peer 4.4.4.4 advertise route-reoriginated evpn ipv6
[*DCI-PE1-bgp-af-evpn] peer 4.4.4.4 advertise irbv6
[*DCI-PE1-bgp-af-evpn] quit
[*DCI-PE1-bgp] quit
[*DCI-PE1] commit
# 配置DCI-PE2。
[~DCI-PE2] bgp 100
[*DCI-PE2-bgp] ipv6-family vpn-instance vpn1
[*DCI-PE2-bgp-6-vpn1] import-route direct
[*DCI-PE2-bgp-6-vpn1] advertise l2vpn evpn
[*DCI-PE2-bgp-6-vpn1] quit
[*DCI-PE2-bgp] l2vpn-family evpn
[*DCI-PE2-bgp-af-evpn] peer 1.1.1.1 import reoriginate
[*DCI-PE2-bgp-af-evpn] peer 1.1.1.1 advertise route-reoriginated evpn mac
[*DCI-PE2-bgp-af-evpn] peer 1.1.1.1 advertise route-reoriginated evpn mac-ipv6
[*DCI-PE2-bgp-af-evpn] peer 1.1.1.1 advertise route-reoriginated evpn ipv6
[*DCI-PE2-bgp-af-evpn] peer 1.1.1.1 advertise irbv6
[*DCI-PE2-bgp-af-evpn] peer 5.5.5.5 import reoriginate
[*DCI-PE2-bgp-af-evpn] peer 5.5.5.5 advertise route-reoriginated evpn mac-ipv6
[*DCI-PE2-bgp-af-evpn] peer 5.5.5.5 advertise route-reoriginated evpn ipv6
[*DCI-PE2-bgp-af-evpn] peer 5.5.5.5 advertise irbv6
[*DCI-PE2-bgp-af-evpn] quit
[*DCI-PE2-bgp] quit
[*DCI-PE2] commit
- 验证配置结果
在DC-PE设备上执行display ipv6 routing-table vpn-instance vpn1命令可查看到私网路由信息,从GW侧收到的路由迭代的是VXLAN隧道,从远端PE收到的路由迭代的是MPLS TE隧道。以DCI-PE1的显示为例:
[~DCI-PE1] display ipv6 routing-table vpn-instance vpn1
Routing Table : vpn1 Destinations : 2 Routes : 2 Destination : 2001:DB8:1:: PrefixLength : 64 NextHop : ::FFFF:4.4.4.4 Preference : 255 Cost : 0 Protocol : EBGP RelayNextHop : :: TunnelID : 0x0000000027f0000001 Interface : VXLAN Flags : RD Destination : 2001:DB8:2:: PrefixLength : 64 NextHop : ::FFFF:3.3.3.3 Preference : 255 Cost : 0 Protocol : IBGP RelayNextHop : ::FFFF:0.0.0.0 TunnelID : 0x000000000300000001 Interface : Tunnel1 Flags : RD
配置文件
DCI-PE1的配置文件
# sysname DCI-PE1 # evpn vpn-instance evrf1 bd-mode route-distinguisher 10:1 tnl-policy te-lsp1 vpn-target 11:1 export-extcommunity vpn-target 11:1 import-extcommunity # ip vpn-instance vpn1 ipv6-family route-distinguisher 11:11 apply-label per-instance vpn-target 11:1 export-extcommunity evpn vpn-target 11:1 import-extcommunity evpn tnl-policy te-lsp1 evpn evpn mpls routing-enable vxlan vni 555 # mpls lsr-id 1.1.1.1 # mpls mpls te mpls rsvp-te mpls te cspf # bridge-domain 10 vxlan vni 5010 split-horizon-mode evpn binding vpn-instance evrf1 # interface Vbdif10 ip binding vpn-instance vpn1 ipv6 enable ipv6 address 2001:DB8:10::1/64 ipv6 nd collect host enable # interface GigabitEthernet1/0/0 undo shutdown ip address 192.168.20.1 255.255.255.0 # interface GigabitEthernet1/0/0.1 mode l2 encapsulation qinq bridge-domain 10 # interface GigabitEthernet2/0/0 undo shutdown ip address 192.168.1.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface LoopBack1 ip address 1.1.1.1 255.255.255.255 # interface LoopBack2 ip address 11.11.11.11 255.255.255.255 # interface Nve1 source 11.11.11.11 # interface Tunnel1 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 3.3.3.3 mpls te tunnel-id 100 # bgp 100 peer 3.3.3.3 as-number 100 peer 3.3.3.3 connect-interface LoopBack1 peer 4.4.4.4 as-number 65410 peer 4.4.4.4 ebgp-max-hop 255 peer 4.4.4.4 connect-interface LoopBack2 # ipv4-family unicast undo synchronization peer 3.3.3.3 enable peer 4.4.4.4 enable # ipv6-family vpn-instance vpn1 import-route direct advertise l2vpn evpn # l2vpn-family evpn undo policy vpn-target peer 3.3.3.3 enable peer 3.3.3.3 advertise irbv6 peer 3.3.3.3 import reoriginate peer 3.3.3.3 advertise route-reoriginated evpn mac peer 3.3.3.3 advertise route-reoriginated evpn mac-ipv6 peer 3.3.3.3 advertise route-reoriginated evpn ipv6 peer 4.4.4.4 enable peer 4.4.4.4 advertise irbv6 peer 4.4.4.4 advertise encap-type vxlan peer 4.4.4.4 import reoriginate peer 4.4.4.4 advertise route-reoriginated evpn mac-ipv6 peer 4.4.4.4 advertise route-reoriginated evpn ipv6 # ospf 1 opaque-capability enable area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 192.168.1.0 0.0.0.255 mpls-te enable # ip route-static 4.4.4.4 255.255.255.255 192.168.20.2 # tunnel-policy te-lsp1 tunnel select-seq cr-lsp load-balance-number 1 # evpn source-address 1.1.1.1 # return
P的配置文件
# sysname P # mpls lsr-id 2.2.2.2 # mpls mpls te mpls rsvp-te mpls te cspf # interface GigabitEthernet1/0/0 undo shutdown ip address 192.168.1.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet2/0/0 undo shutdown ip address 192.168.10.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface LoopBack1 ip address 2.2.2.2 255.255.255.255 # ospf 1 opaque-capability enable area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 192.168.1.0 0.0.0.255 network 192.168.10.0 0.0.0.255 mpls-te enable # return
DCI-PE2的配置文件
# sysname DCI-PE2 # evpn vpn-instance evrf1 bd-mode route-distinguisher 10:1 tnl-policy te-lsp1 vpn-target 11:1 export-extcommunity vpn-target 11:1 import-extcommunity # ip vpn-instance vpn1 ipv6-family route-distinguisher 11:11 apply-label per-instance vpn-target 11:1 export-extcommunity evpn vpn-target 11:1 import-extcommunity evpn tnl-policy te-lsp1 evpn evpn mpls routing-enable vxlan vni 555 # mpls lsr-id 3.3.3.3 # mpls mpls te mpls rsvp-te mpls te cspf # bridge-domain 10 vxlan vni 5020 split-horizon-mode evpn binding vpn-instance evrf1 # interface Vbdif10 ip binding vpn-instance vpn1 ipv6 enable ipv6 address 2001:DB8:20::1/64 ipv6 nd collect host enable # interface GigabitEthernet1/0/0 undo shutdown ip address 192.168.30.1 255.255.255.0 # interface GigabitEthernet1/0/0.1 mode l2 encapsulation qinq bridge-domain 10 # interface GigabitEthernet2/0/0 undo shutdown ip address 192.168.10.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface LoopBack1 ip address 3.3.3.3 255.255.255.255 # interface LoopBack2 ip address 33.33.33.33 255.255.255.255 # interface Nve1 source 33.33.33.33 # interface Tunnel1 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 1.1.1.1 mpls te tunnel-id 100 # bgp 100 peer 1.1.1.1 as-number 100 peer 1.1.1.1 connect-interface LoopBack1 peer 5.5.5.5 as-number 65420 peer 5.5.5.5 ebgp-max-hop 255 peer 5.5.5.5 connect-interface LoopBack2 # ipv4-family unicast undo synchronization peer 1.1.1.1 enable peer 5.5.5.5 enable # ipv6-family vpn-instance vpn1 import-route direct advertise l2vpn evpn # l2vpn-family evpn undo policy vpn-target peer 1.1.1.1 enable peer 1.1.1.1 advertise irbv6 peer 1.1.1.1 import reoriginate peer 1.1.1.1 advertise route-reoriginated evpn mac peer 1.1.1.1 advertise route-reoriginated evpn mac-ipv6 peer 1.1.1.1 advertise route-reoriginated evpn ipv6 peer 5.5.5.5 enable peer 5.5.5.5 advertise irbv6 peer 5.5.5.5 advertise encap-type vxlan peer 5.5.5.5 import reoriginate peer 5.5.5.5 advertise route-reoriginated evpn mac-ipv6 peer 5.5.5.5 advertise route-reoriginated evpn ipv6 # ospf 1 opaque-capability enable area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 192.168.10.0 0.0.0.255 mpls-te enable # ip route-static 5.5.5.5 255.255.255.255 192.168.30.2 # tunnel-policy te-lsp1 tunnel select-seq cr-lsp load-balance-number 1 # evpn source-address 3.3.3.3 # return
GW1的配置文件
请参考数据中心设备配置文件。
Device1的配置文件
请参考数据中心设备配置文件。
Device2的配置文件
请参考数据中心设备配置文件。
GW2的配置文件
请参考数据中心设备配置文件。
Device3配置文件
请参考数据中心设备配置文件。
Device4配置文件
请参考数据中心设备配置文件。