配置VLAN Base接入MPLS EVPN IRB的DCI场景示例(PE兼做GW)
Underlay VLAN三层接入DCI采用不同的云平台管理,通过以太子接口关联VLAN方式接入DCI骨干网,数据中心网关设备和DCI骨干网PE设备是同一台设备,该类设备之间部署BGP EVPN功能。
组网需求
合设设备指数据中心网关设备和DCI骨干网PE设备是同一台设备,其直接连接数据中心设备。如图12-62所示,数据中心网关设备和DCI骨干网PE设备是同一台设备(DC-PE-GW),其一侧连接DCI骨干网的P设备,另一侧直接连接数据中心的Device设备。数据中心内部通过建立VXLAN隧道实现各数据中心内部VM之间的互通。为了实现跨数据中心VM之间的通信,用户可以在DCI骨干网络的DCI-PE-GW设备上创建L3VPN实例和EVPN实例,并部署在DCI-PE-GW设备间部署BGP EVPN功能,实现各数据中心内部VM之间的通信。
本示例中interface1,interface2,sub-interface1.1分别代表GE1/0/0,GE2/0/0,GE1/0/0.1。
设备 |
接口 |
IP地址 |
---|---|---|
DCI-PE1-GW1 |
GigabitEthernet 1/0/0.1 |
- |
GigabitEthernet 2/0/0 |
192.168.1.1/24 |
|
LoopBack1 |
1.1.1.1/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-GW2 |
GigabitEthernet 1/0/0.1 |
- |
GigabitEthernet 2/0/0 |
192.168.10.2/24 |
|
LoopBack1 |
3.3.3.3/32 |
配置思路
采用如下的思路进行配置:
DCI骨干网上配置OSPF实现DCI-PE-GW之间的互通。
DCI骨干网上配置MPLS TE隧道。
DCI-PE-GW上配置VPN实例,并应用隧道策略。
DCI-PE-GW上创建VBDIF接口,并把VBDIF接口和相应的VPN实例绑定。
DCI-PE-GW上配置发布IP前缀类型的路由。
DCI-PE-GW上配置EVPN实例并在DCI-PE-GW之间建立BGP EVPN对等体关系,并发布IRB路由。
DCI-PE-GW上配置源地址。
数据准备
为完成此配置例,需准备如下的数据:
DCI-PE-GW及P上的MPLS LSR-ID。
VPN实例的RD。
VPN实例的收发路由属性VPN-Target。
EVPN实例的RD。
EVPN实例的收发路由属性VPN-Target。
操作步骤
- 配置各节点接口的IP地址及Loopback接口的地址
具体配置过程请参考配置文件。
- 在DCI骨干网上配置IGP,本示例使用OSPF
具体配置过程请参考配置文件。
- 在DCI骨干网上配置MPLS TE隧道
具体配置过程请参考配置文件。
- 在DCI-PE-GW设备上配置VPN实例,并应用隧道策略
# 配置DCI-PE1-GW1。
[~DCI-PE1-GW1] tunnel-policy te-lsp1
[*DCI-PE1-GW1-tunnel-policy-te-lsp1] tunnel select-seq cr-lsp load-balance-number 1
[*DCI-PE1-GW1-tunnel-policy-te-lsp1] quit
[*DCI-PE1-GW1] ip vpn-instance vpn1
[*DCI-PE1-GW1-vpn-instance-vpn1] ipv4-family
[*DCI-PE1-GW1-vpn-instance-vpn1-af-ipv4] route-distinguisher 11:11
[*DCI-PE1-GW1-vpn-instance-vpn1-af-ipv4] tnl-policy te-lsp1 evpn
[*DCI-PE1-GW1-vpn-instance-vpn1-af-ipv4] vpn-target 11:1 both evpn
[*DCI-PE1-GW1-vpn-instance-vpn1-af-ipv4] evpn mpls routing-enable
[*DCI-PE1-GW1-vpn-instance-vpn1-af-ipv4] quit
[*DCI-PE1-GW1-vpn-instance-vpn1] quit
[*DCI-PE1-GW1] commit
# 配置DCI-PE2-GW2。
[~DCI-PE2-GW2] tunnel-policy te-lsp1
[*DCI-PE2-GW2-tunnel-policy-te-lsp1] tunnel select-seq cr-lsp load-balance-number 1
[*DCI-PE2-GW2-tunnel-policy-te-lsp1] quit
[*DCI-PE2-GW2] ip vpn-instance vpn1
[*DCI-PE2-GW2-vpn-instance-vpn1] ipv4-family
[*DCI-PE2-GW2-vpn-instance-vpn1-af-ipv4] route-distinguisher 11:11
[*DCI-PE2-GW2-vpn-instance-vpn1-af-ipv4] tnl-policy te-lsp1 evpn
[*DCI-PE2-GW2-vpn-instance-vpn1-af-ipv4] vpn-target 11:1 both evpn
[*DCI-PE2-GW2-vpn-instance-vpn1-af-ipv4] evpn mpls routing-enable
[*DCI-PE2-GW2-vpn-instance-vpn1-af-ipv4] quit
[*DCI-PE2-GW2-vpn-instance-vpn1] quit
[*DCI-PE2-GW2] commit
- 在DCI-PE-GW上配置发布IP前缀类型的路由。
# 配置DCI-PE1-GW1。
[~DCI-PE1-GW1] bgp 100
[*DCI-PE1-GW1-bgp] ipv4-family vpn-instance vpn1
[*DCI-PE1-GW1-bgp-vpn1] import-route direct
[*DCI-PE1-GW1-bgp-vpn1] advertise l2vpn evpn
[*DCI-PE1-GW1-bgp-vpn1] quit
[*DCI-PE1-GW1] commit
# 配置DCI-PE2-GW2。
[~DCI-PE2-GW2] bgp 100
[*DCI-PE2-GW2-bgp] ipv4-family vpn-instance vpn1
[*DCI-PE2-GW2-bgp-vpn1] import-route direct
[*DCI-PE2-GW2-bgp-vpn1] advertise l2vpn evpn
[*DCI-PE2-GW2-bgp-vpn1] quit
[*DCI-PE2-GW2] commit
- DCI-PE-GW上配置EVPN实例并在DCI-PE-GW之间建立BGP EVPN对等体关系,并发布IRB路由。
# 配置DCI-PE1-GW1。
[~DCI-PE1-GW1] evpn vpn-instance evrf1 bd-mode
[*DCI-PE1-GW1-evpn-instance-evrf1] route-distinguisher 10:1
[*DCI-PE1-GW1-evpn-instance-evrf1] vpn-target 11:1
[*DCI-PE1-GW1-evpn-instance-evrf1] tnl-policy te-lsp1
[*DCI-PE1-GW1-evpn-instance-evrf1] quit
[*DCI-PE1-GW1] bridge-domain 10
[*DCI-PE1-GW1-bd10] evpn binding vpn-instance evrf1
[*DCI-PE1-GW1-bd10] quit
[*DCI-PE1-GW1] bgp 100
[*DCI-PE1-GW1-bgp] peer 3.3.3.3 as-number 100
[*DCI-PE1-GW1-bgp] peer 3.3.3.3 connect-interface loopback 1
[*DCI-PE1-GW1-bgp] l2vpn-family evpn
[*DCI-PE1-GW1-bgp-af-evpn] peer 3.3.3.3 enable
[*DCI-PE1-GW1-bgp-af-evpn] peer 3.3.3.3 advertise irb
[*DCI-PE1-GW1-bgp-af-evpn] quit
[*DCI-PE1-GW1-bgp] quit
[*DCI-PE1-GW1] commit
# 配置DCI-PE2-GW2。
[~DCI-PE2-GW2] evpn vpn-instance evrf1 bd-mode
[*DCI-PE2-GW2-evpn-instance-evrf1] route-distinguisher 10:1
[*DCI-PE2-GW2-evpn-instance-evrf1] vpn-target 11:1
[*DCI-PE2-GW1-evpn-instance-evrf1] tnl-policy te-lsp1
[*DCI-PE2-GW2-evpn-instance-evrf1] quit
[*DCI-PE2-GW2] bridge-domain 10
[*DCI-PE2-GW2-bd10] evpn binding vpn-instance evrf1
[*DCI-PE2-GW2-bd10] quit
[*DCI-PE2-GW2] bgp 100
[*DCI-PE2-GW2-bgp] peer 1.1.1.1 as-number 100
[*DCI-PE2-GW2-bgp] peer 1.1.1.1 connect-interface loopback 1
[*DCI-PE2-GW2-bgp] l2vpn-family evpn
[*DCI-PE2-GW2-bgp-af-evpn] peer 1.1.1.1 enable
[*DCI-PE2-GW2-bgp-af-evpn] peer 1.1.1.1 advertise irb
[*DCI-PE2-GW2-bgp-af-evpn] quit
[*DCI-PE2-GW2-bgp] quit
[*DCI-PE2-GW2] commit
- DCI-PE-GW上创建VBDIF接口
# 配置DCI-PE1-GW1。
[~DCI-PE1-GW1] interface gigabitethernet 1/0/0.1 mode l2
[*DCI-PE1-GW1-GigabitEthernet1/0/0.1] encapsulation dot1q vid 10
[*DCI-PE1-GW1-GigabitEthernet1/0/0.1] rewrite pop single
[*DCI-PE1-GW1-GigabitEthernet1/0/0.1] bridge-domain 10
[*DCI-PE1-GW1-GigabitEthernet1/0/0.1] quit
[*DCI-PE1-GW1] interface Vbdif10
[*DCI-PE1-GW1-Vbdif10] ip binding vpn-instance vpn1
[*DCI-PE1-GW1-Vbdif10] ip address 10.1.1.1 255.255.255.0
[*DCI-PE1-GW1-Vbdif10] arp collect host enable
[*DCI-PE1-GW1-Vbdif10] quit
[*DCI-PE1-GW1] commit
# 配置DCI-PE2-GW2。
[~DCI-PE2-GW2] interface gigabitethernet 1/0/0.1 mode l2
[*DCI-PE2-GW2-GigabitEthernet1/0/0.1] encapsulation dot1q vid 10
[*DCI-PE2-GW2-GigabitEthernet1/0/0.1] rewrite pop single
[*DCI-PE2-GW2-GigabitEthernet1/0/0.1] bridge-domain 10
[*DCI-PE2-GW2-GigabitEthernet1/0/0.1] quit
[*DCI-PE2-GW2] interface Vbdif10
[*DCI-PE2-GW2-Vbdif10] ip binding vpn-instance vpn1
[*DCI-PE2-GW2-Vbdif10] ip address 10.2.1.1 255.255.255.0
[*DCI-PE2-GW2-Vbdif10] arp collect host enable
[*DCI-PE2-GW2-Vbdif10] quit
[*DCI-PE2-GW2] commit
- 在DCI-PE-GW上配置源地址。
# 配置DCI-PE-GW1。
[~DCI-PE-GW1] evpn source-address 1.1.1.1
[*DCI-PE-GW1] commit
# 配置DCI-PE-GW2。
[~DCI-PE-GW2] evpn source-address 3.3.3.3
[*DCI-PE-GW2] commit
- 验证配置结果
在DCI-PE-GW设备上执行display bgp evpn all routing-table命令,可以看到从远端DCI-PE-GW收到的EVPN IRB路由。以DCI-PE1-GW1的显示为例:
[~DCI-PE1-GW1] display bgp evpn all routing-table
Local AS number : 100 BGP Local router ID is 192.168.1.1 Status codes: * - valid, > - best, d - damped, x - best external, a - add path, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete EVPN address family: Number of Mac Routes: 4 Route Distinguisher: 10:1 Network(EthTagId/MacAddrLen/MacAddr/IpAddrLen/IpAddr) NextHop *>i 0:48:00e0-fc12-3456:0:0.0.0.0 3.3.3.3 *>i 0:48:00e0-fc12-3456:32:20.1.1.1 3.3.3.3 *> 0:48:00e0-fc12-7890:0:0.0.0.0 0.0.0.0 *> 0:48:00e0-fc12-7890:32:10.1.1.1 0.0.0.0 EVPN-Instance evrf1: Number of Mac Routes: 4 Network(EthTagId/MacAddrLen/MacAddr/IpAddrLen/IpAddr) NextHop *>i 0:48:00e0-fc12-3456:0:0.0.0.0 3.3.3.3 *>i 0:48:00e0-fc12-3456:32:20.1.1.1 3.3.3.3 *> 0:48:00e0-fc12-7890:0:0.0.0.0 0.0.0.0 *> 0:48:00e0-fc12-7890:32:10.1.1.1 0.0.0.0 EVPN address family: Number of Inclusive Multicast Routes: 2 Route Distinguisher: 10:1 Network(EthTagId/IpAddrLen/OriginalIp) NextHop *> 0:32:1.1.1.1 127.0.0.1 *>i 0:32:3.3.3.3 3.3.3.3 EVPN-Instance evrf1: Number of Inclusive Multicast Routes: 2 Network(EthTagId/IpAddrLen/OriginalIp) NextHop *> 0:32:1.1.1.1 127.0.0.1 *>i 0:32:3.3.3.3 3.3.3.3 EVPN address family: Number of Ip Prefix Routes: 2 Route Distinguisher: 11:11 Network(EthTagId/IpPrefix/IpPrefixLen) NextHop *> 0:10.1.1.0:24 0.0.0.0 *>i 0:10.2.1.0:24 3.3.3.3
在DC-PE-GW设备上执行display ip routing-table vpn-instance命令,可以看到从远端DC-PE-GW收到的私网路由。以DCI-PE1-GW1的显示为例:
[~DCI-PE1-GW1] 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 : 7 Routes : 7 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vbdif10 10.1.1.1/32 Direct 0 0 D 127.0.0.1 Vbdif10 10.1.1.255/32 Direct 0 0 D 127.0.0.1 Vbdif10 10.2.1.0/24 IBGP 255 0 RD 3.3.3.3 Tunnel1 10.2.1.1/32 IBGP 255 0 RD 3.3.3.3 Tunnel1 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
配置文件
DCI-PE1-GW1的配置文件
# sysname DCI-PE1-GW1 # 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 ipv4-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 # mpls lsr-id 1.1.1.1 # mpls mpls te mpls rsvp-te mpls te cspf # bridge-domain 10 evpn binding vpn-instance evrf1 # interface Vbdif10 ip binding vpn-instance vpn1 ip address 10.1.1.1 255.255.255.0 arp collect host enable # interface GigabitEthernet1/0/0 undo shutdown # interface GigabitEthernet1/0/0.1 mode l2 encapsulation dot1q vid 10 rewrite pop single 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 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 # ipv4-family unicast undo synchronization peer 3.3.3.3 enable # ipv4-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 irb # 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 # 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-GW2的配置文件
# sysname DCI-PE2-GW2 # 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 ipv4-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 # mpls lsr-id 3.3.3.3 # mpls mpls te mpls rsvp-te mpls te cspf # bridge-domain 10 evpn binding vpn-instance evrf1 # interface Vbdif10 ip binding vpn-instance vpn1 ip address 10.2.1.1 255.255.255.0 arp collect host enable # interface GigabitEthernet1/0/0 undo shutdown # interface GigabitEthernet1/0/0.1 mode l2 encapsulation dot1q vid 10 rewrite pop single 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 Pos3/1/3 link-protocol ppp undo shutdown # interface LoopBack1 ip address 3.3.3.3 255.255.255.255 # 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 # ipv4-family unicast undo synchronization peer 1.1.1.1 enable # ipv4-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 irb # 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 # tunnel-policy te-lsp1 tunnel select-seq cr-lsp load-balance-number 1 # evpn source-address 3.3.3.3 # return
Device1的配置文件
请参考数据中心设备配置文件。
Device2的配置文件
请参考数据中心设备配置文件。