实验拓扑下载链接:链接:百度网盘 请输入提取码
答:
配置思路:
underlay配置ospf互通,并配置CE3为RR,CE1,CE2为客户端,建立BGP EVPN邻居。
CE1,CE2创建创建实例A,分配vxlan vni,然后分别在CE1和CE2上绑定实例A,创建
BD,并绑定实例A。对应接口下创建二层子接口绑定BD和VLAN id。
CE1,CE2建立Vbdif接口分配网关地址,实现分布式网关。
CE3上建立三层实例X,为实例配置去往外网的默认路由,并在bgp 实例下引入静态路
由和下发静态路由
关键配置:
CE1:
evpn-overlay enable
#
ip vpn-instance A
ipv4-family
route-distinguisher 100:1
vpn-target 11:1 export-extcommunity evpn
vpn-target 11:1 import-extcommunity evpn
vxlan vni 100
#
bridge-domain 15
vxlan vni 15
evpn
route-distinguisher 100:1
vpn-target 100:100 export-extcommunity
vpn-target 11:1 export-extcommunity
vpn-target 100:100 import-extcommunity
#
bridge-domain 20
vxlan vni 20
evpn
route-distinguisher 100:2
vpn-target 200:200 export-extcommunity
vpn-target 11:1 export-extcommunity
vpn-target 200:200 import-extcommunity
#
interface Vbdif15
ip binding vpn-instance A
ip address 192.168.15.254 255.255.255.0
mac-address 0000-005e-0115
vxlan anycast-gateway enable
arp collect host enable
#
interface Vbdif20
ip binding vpn-instance A
ip address 192.168.20.254 255.255.255.0
mac-address 0000-005e-0120
vxlan anycast-gateway enable
arp collect host enable
#
interface GE1/0/1.15 mode l2
encapsulation dot1q vid 15
bridge-domain 15
#
interface GE1/0/1.20 mode l2
encapsulation dot1q vid 20
bridge-domain 20
#
#
interface Nve1
source 1.1.1.1
vni 15 head-end peer-list protocol bgp
vni 20 head-end peer-list protocol bgp
#
bgp 100
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
#
ipv4-family unicast
peer 3.3.3.3 enable
#
l2vpn-family evpn
policy vpn-target
peer 3.3.3.3 enable
peer 3.3.3.3 advertise irb
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 15.1.1.1 0.0.0.0
#
CE2配置类似
CE3:
#
evpn-overlay enable
#
ip vpn-instance X
ipv4-family
route-distinguisher 100:3
vpn-target 11:1 export-extcommunity evpn
vpn-target 11:1 import-extcommunity evpn
vxlan vni 200
#
interface GE1/0/1
undo portswitch
undo shutdown
ip binding vpn-instance X
ip address 39.1.1.3 255.255.255.0
#
interface Nve1
source 3.3.3.3
#
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack0
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0
#
ipv4-family unicast
peer 1.1.1.1 enable
peer 2.2.2.2 enable
#
ipv4-family vpn-instance X
default-route imported
import-route direct
import-route static
advertise l2vpn evpn
#
l2vpn-family evpn
undo policy vpn-target
peer 1.1.1.1 enable
peer 1.1.1.1 advertise irb
peer 1.1.1.1 reflect-client
peer 2.2.2.2 enable
peer 2.2.2.2 advertise irb
peer 2.2.2.2 reflect-client
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 35.1.1.3 0.0.0.0
#
ip route-static vpn-instance X 0.0.0.0 0.0.0.0 39.1.1.9
最终实验效果截图: