配置VXLAN EVPN L3VPN接入普通L3VPN的DCI场景示例
本节介绍VXLAN EVPN L3VPN接入普通L3VPN的DCI场景的配置方法,即在该示例中数据中心网关通过VXLAN隧道接入到DCI网络中的PE设备,DCI网络中部署普通L3VPN功能来实现数据中心互连。
组网需求
如图12-49所示,数据中心网关设备GW1和GW2分别连接到骨干网络上,通过在DCI骨干网络上部署BGP/MPLS IP VPN功能,在GW和DCI-PE之间部署EVPN协议和VXLAN隧道来传递VM主机IP路由信息,实现数据中心A和数据中心B之间的互相通信(例如VMa1和VMb2之间互相通信)。
设备 |
接口 |
IP地址 |
---|---|---|
DCI-PE1 |
GigabitEthernet 1/0/0 |
192.168.20.1/24 |
GigabitEthernet 2/0/0 |
192.168.1.1/24 |
|
LoopBack1 |
1.1.1.1/32 |
|
LoopBack2 |
11.11.11.11/32 |
|
RR |
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/24 |
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之间配置VXLAN隧道。
DCI-PE上配置VPN实例,并把与GW相连的接口和相应的VPN实例绑定。
DCI-PE和RR之间配置MP-IBGP交换VPNv4路由信息,其中RR上部署反射器功能。
在DCI-PE上配置路由重生成功能。
操作步骤
- 配置各节点接口的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 20: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
- 配置VXLAN隧道
- 配置VPN实例应用隧道策略
# 配置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] ipv4-family
[*DCI-PE1-vpn-instance-vpn1-af-ipv4] tnl-policy te-lsp1
[*DCI-PE1-vpn-instance-vpn1-af-ipv4] quit
[*DCI-PE1-vpn-instance-vpn1] 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] ipv4-family
[*DCI-PE2-vpn-instance-vpn1-af-ipv4] tnl-policy te-lsp1
[*DCI-PE2-vpn-instance-vpn1-af-ipv4] quit
[*DCI-PE2-vpn-instance-vpn1] quit
[*DCI-PE2] commit
- DCI-PE和RR之间配置MP-IBGP交换VPNv4路由信息,其中RR上部署反射器功能
# 配置DCI-PE1。
[~DCI-PE1] bgp 100
[*DCI-PE1-bgp] peer 2.2.2.2 as-number 100
[*DCI-PE1-bgp] peer 2.2.2.2 connect-interface loopback 1
[*DCI-PE1-bgp] ipv4-family vpnv4
[*DCI-PE1-bgp-af-vpnv4] peer 2.2.2.2 enable
[*DCI-PE1-bgp-af-vpnv4] quit
[*DCI-PE1-bgp] quit
[*DCI-PE1] commit
# 配置RR。
[~RR] bgp 100
[*RR-bgp] peer 1.1.1.1 as-number 100
[*RR-bgp] peer 1.1.1.1 connect-interface loopback 1
[*RR-bgp] peer 3.3.3.3 as-number 100
[*RR-bgp] peer 3.3.3.3 connect-interface loopback 1
[*RR-bgp] ipv4-family vpnv4
[*RR-bgp-af-vpnv4] peer 1.1.1.1 enable
[*RR-bgp-af-vpnv4] peer 1.1.1.1 reflect-client
[*RR-bgp-af-vpnv4] peer 3.3.3.3 enable
[*RR-bgp-af-vpnv4] peer 3.3.3.3 reflect-client
[*RR-bgp-af-vpnv4] quit
[*RR-bgp] quit
[*RR] commit
# 配置DCI-PE2。
[~DCI-PE2] bgp 100
[*DCI-PE2-bgp] peer 2.2.2.2 as-number 100
[*DCI-PE2-bgp] peer 2.2.2.2 connect-interface loopback 1
[*DCI-PE2-bgp] ipv4-family vpnv4
[*DCI-PE2-bgp-af-vpnv4] peer 2.2.2.2 enable
[*DCI-PE2-bgp-af-vpnv4] quit
[*DCI-PE2-bgp] quit
[*DCI-PE2] commit
- 配置向VPNv4对等体发布EVPN地址族重生成后的路由,向EVPN对等体发布VPNv4地址族重生成后的路由
# 配置DCI-PE1。
[~DCI-PE1] bgp 100
[*DCI-PE1-bgp] l2vpn-family evpn
[*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 vpnv4
[*DCI-PE1-bgp-af-evpn] quit
[*DCI-PE1-bgp] ipv4-family vpnv4
[*DCI-PE1-bgp-af-vpnv4] peer 3.3.3.3 advertise route-reoriginated evpn mac-ip
[*DCI-PE1-bgp-af-vpnv4] peer 3.3.3.3 advertise route-reoriginated evpn ip
[*DCI-PE1-bgp-af-vpnv4] peer 3.3.3.3 import reoriginate
[*DCI-PE1-bgp-af-vpnv4] quit
[*DCI-PE1-bgp] ipv4-family vpn-instance vpn1
[*DCI-PE1-bgp-vpn1] advertise l2vpn evpn
[*DCI-PE1-bgp-vpn1] quit
[*DCI-PE1-bgp] quit
[*DCI-PE1] commit
# 配置DCI-PE2。
[~DCI-PE2] bgp 100
[*DCI-PE1-bgp] l2vpn-family evpn
[*DCI-PE1-bgp-af-evpn] peer 5.5.5.5 import reoriginate
[*DCI-PE1-bgp-af-evpn] peer 5.5.5.5 advertise route-reoriginated vpnv4
[*DCI-PE1-bgp-af-evpn] quit
[*DCI-PE2-bgp] ipv4-family vpnv4
[*DCI-PE2-bgp-af-vpnv4] peer 1.1.1.1 import reoriginate
[*DCI-PE2-bgp-af-vpnv4] peer 1.1.1.1 advertise route-reoriginated evpn mac-ip
[*DCI-PE2-bgp-af-vpnv4] peer 1.1.1.1 advertise route-reoriginated evpn ip
[*DCI-PE2-bgp-af-vpnv4] quit
[*DCI-PE2-bgp] ipv4-family vpn-instance vpn1
[*DCI-PE2-bgp-vpn1] advertise l2vpn evpn
[*DCI-PE2-bgp-vpn1] quit
[*DCI-PE2-bgp] quit
[*DCI-PE2] commit
- 验证配置结果
在DC-PE设备上执行display ip routing-table vpn-instance命令,可以看到去往GW上的Loopback口路由。以DCI-PE1的显示为例:
[~DCI-PE1] display ip routing-table vpn-instance vpn1
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------ Routing Table : vpn1 Destinations : 6 Routes : 6 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.1.1.0/24 EBGP 255 0 RD 4.4.4.4 VXLAN 10.1.1.1/32 EBGP 255 0 RD 4.4.4.4 VXLAN 10.2.1.0/24 IBGP 255 0 RD 3.3.3.3 Tunnel10 10.2.1.1/32 IBGP 255 0 RD 3.3.3.3 Tunnel10 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
在DC-PE设备上执行display vxlan tunnel命令可查看到VXLAN隧道信息。以DCI-PE1的显示为例:
[~DCI-PE1] display vxlan tunnel
Number of vxlan tunnel : 1 Tunnel ID Source Destination State Type Uptime ----------------------------------------------------------------------------------- 4026531843 11.11.11.11 4.4.4.4 up dynamic 00:51:23
配置文件
DCI-PE1的配置文件
# sysname DCI-PE1 # evpn vpn-instance evrf1 bd-mode route-distinguisher 10:1 vpn-target 11:1 export-extcommunity vpn-target 11:1 import-extcommunity # ip vpn-instance vpn1 ipv4-family route-distinguisher 11:11 apply-label per-instance tnl-policy te-lsp1 vpn-target 1:1 export-extcommunity vpn-target 11:1 export-extcommunity evpn vpn-target 1:1 import-extcommunity vpn-target 11:1 import-extcommunity evpn 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 esi 0000.1111.1111.4444.5555 # interface Vbdif10 ip binding vpn-instance vpn1 ip address 10.10.10.1 255.255.255.0 arp 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 isis enable 1 # interface LoopBack2 ip address 11.11.11.11 255.255.255.255 # interface Nve1 source 11.11.11.11 # interface Tunnel10 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 3.3.3.3 mpls te tunnel-id 100 # bgp 100 peer 2.2.2.2 as-number 100 peer 2.2.2.2 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 2.2.2.2 enable peer 4.4.4.4 enable # ipv4-family vpnv4 policy vpn-target peer 2.2.2.2 enable peer 2.2.2.2 import reoriginate peer 2.2.2.2 advertise route-reoriginated evpn mac-ip peer 2.2.2.2 advertise route-reoriginated evpn ip # ipv4-family vpn-instance vpn1 advertise l2vpn evpn # l2vpn-family evpn undo policy vpn-target peer 4.4.4.4 enable peer 4.4.4.4 advertise encap-type vxlan peer 4.4.4.4 import reoriginate peer 4.4.4.4 advertise route-reoriginated vpnv4 # 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
RR的配置文件
# sysname RR # 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 # bgp 100 peer 1.1.1.1 as-number 100 peer 1.1.1.1 connect-interface LoopBack1 peer 3.3.3.3 as-number 100 # ipv4-family unicast undo synchronization peer 1.1.1.1 enable peer 3.3.3.3 enable # ipv4-family vpnv4 undo policy vpn-target peer 1.1.1.1 enable peer 1.1.1.1 reflect-client peer 3.3.3.3 enable peer 3.3.3.3 reflect-client # 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 20:1 vpn-target 11:1 export-extcommunity vpn-target 11:1 import-extcommunity # ip vpn-instance vpn1 ipv4-family route-distinguisher 22:22 apply-label per-instance tnl-policy te-lsp1 vpn-target 1:1 export-extcommunity vpn-target 11:1 export-extcommunity evpn vpn-target 1:1 import-extcommunity vpn-target 11:1 import-extcommunity evpn 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 esi 0000.1111.3333.4444.5555 # interface Vbdif10 ip binding vpn-instance vpn1 ip address 10.20.10.1 255.255.255.0 arp 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 isis enable 1 # interface LoopBack2 ip address 33.33.33.33 255.255.255.255 # interface Nve1 source 33.33.33.33 # interface Tunnel10 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 1.1.1.1 mpls te tunnel-id 100 # bgp 100 peer 2.2.2.2 as-number 100 peer 2.2.2.2 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 2.2.2.2 enable peer 5.5.5.5 enable # ipv4-family vpnv4 policy vpn-target peer 2.2.2.2 enable peer 2.2.2.2 import reoriginate peer 2.2.2.2 advertise route-reoriginated evpn mac-ip peer 2.2.2.2 advertise route-reoriginated evpn ip # ipv4-family vpn-instance vpn1 advertise l2vpn evpn # l2vpn-family evpn undo policy vpn-target peer 5.5.5.5 enable peer 5.5.5.5 advertise encap-type vxlan peer 5.5.5.5 import reoriginate peer 5.5.5.5 advertise route-reoriginated vpnv4 # 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配置文件
请参考数据中心设备配置文件。