实验
1.开启over支持evpn的功能 2.建立EVPN BGP对等体关系 3.创建BD,绑定VNI与EVPN实例 4.进入接口,绑定BD 5.进入隧道接口,配置源与头部复制列表 CE2 evpn-overlay enable //开启支持evpn overlay的功能 bgp 123 peer 3.3.3.3 as-number 123 peer 3.3.3.3 connect-interface l0 # l2vpn-family evpn //建立EVPN邻居 policy vpn-target peer 3.3.3.3 enable # bridge-domain 1030 //创建BD vxlan vni 1030 evpn //创建EVPN实例,绑定到BD里面 route-distinguisher 1030:2 vpn-target 1030:1030 export-extcommunity vpn-target 1030:1030 import-extcommunity # bridge-domain 2040 vxlan vni 2040 evpn route-distinguisher 2040:2 vpn-target 2040:2040 export-extcommunity vpn-target 2040:2040 import-extcommunity # interface G1/0/9.10 mode l2 encapsulation dot1q vid 10 bridge-domain 1030 # interface G1/0/9.20 mode l2 encapsulation dot1q vid 20 bridge-domain 2040 # int Nve 1 //进入到VNI里面 source 2.2.2.2 vni 1030 head-end peer-list protocol bgp //1030隧道根据BGP来建立 vni 2040 head-end peer-list protocol bgp
CE1: 1.开启over支持evpn的功能 2.建立BGP EVPN对等体关系,且配置反射客户端与通告ARP路由功能 3.创建BD,绑定VNI与EVPN实例 4.配置VBDIF地址及arp collect host enable 5.进入隧道接口,配置源地址与头部复制列表 CE2: 1.开启over支持evpn的功能 2.建立EVPN BGP对等体关系,并通告arp路由功能 3.创建BD,绑定VNI与EVPN实例 4.进入接口,绑定BD 5.进入隧道接口,配置源与头部复制列表 CE1 evpn-overlay enable bridge-domain 1030 vxlan vni 1030 evpn route-distingusisher 1030:1 vpn-target 1030:1030 export-extocommunity vpn-target 1030:1030 import-extcommunity # bridge-domain 2040 vxlan vni 2040 evpn route-distinguisher 2040:1 vpn-target 2040:2040 export-extcommunity vpn-tartge 2040:2040 import-extcommunity # interface vbdif1030 ip add 192.168.1.1 24 interface vbdif 2040 ip add 192.168.2.1 24 # bgp 123 peer 2.2.2.2 as-number 123 peer 2.2.2.2 connect-interface l0 peer 3.3.3.3 as-number 123 peer 3.3.3.3 connect-interface l0 # l2vpn-family evpn policy vpn-target peer 2.2.2.2 enable peer 2.2.2.2 relect0clinet peer 2.2.2.2 advertise arp peer 3.3.3.3 enable peer 3.3.3.3 relect-client peer 3.3.3.3 advertise arp # interface Nve1 source 1.1.1.1 vni 1030 head-end peer-list protocol bgp vni 2040 head-end peer-list protocol bgp CE2 evpn-overlay enable bridge-domain 1030 vxlan vni 1030 evpn route-distinguisher 1030:2 vpn-target 1030:1030 export-extcommunity vpn-target 1030:1030 import-extcommunity # interface G1/0/9.10 mode l2 encapsulation dot1q vid 10 bridge-domain 1030 # bgp 123 peer 1.1.1.1 as-number 123 peer 1.1.1.1 connect-interface l0 l2vpn-family evpn policy vpn-target peer 1.1.1.1 enable peer 1.1.1.1 advertise arp interface Nve 1 source 2.2.2.2 vni 1030 head-end peer-list protocol bgp CE3 evpn-overlay enable bridge-domain 2040 vxlan vni 2040 evpn route-distinguisher 2040:3 vpn-target 2040:2040 export-extcommunity vpn-target 2040:2040 import-extommunity # interface G1/0/9.10 mode l2 encapsulation dot1q vid 40 bridge-domain 2040 # bgp 123 peer 1.1.1.1 as-number 123 peer 1.1.1.1 connect-interface l0 l2vpn-family evpn policy vpn-target peer 1.1.1.1 enable peer 1.1.1.1 advertise arp # interface Nve 1 sorece 3.3.3.3 vni 2040 head-end peer-list protocol bgp CE1 interface vbdif1030 arp collect host enable //主机收集功能
CE2 evpn-overlay enable bridge-domain 1030 vxlan vni 1030 evpn route-distinguisher 1030:1030 vpn-target 1030:1030 export-extcommunity vpn-target 1234:1234 export-extcommunity vpn-target 1030:1030 import-extcommunity # bridge-domain 2040 vxlan vni 2040 evpn route-distinguisher 2040:2040 vpn-target 2040:2040 export-extcommunity vpn-target 1234:1234 export-extcommunity vpn-target 2040:2040 import-extcommunity ### ip vpn-instance vpn1 route-distinguisher 1234:1234 vpn-target 1234:1234 export-extcommunity evpn vpn-target 1234:1234 import-extcommunity evpn vxlan vni 1234 # interface GE1/0/9 undo shutdown # interface GE1/0/9.30 mode l2 encapsulation dot1q vid 10 bridge-domain 1030 # interface GE1/0/9.40 mode l2 encapsulation dot1q vid 20 bridge-domain 2040 # interface Vbdif1030 ip binding vpn-instance vpn1 ip address 192.168.1.1 255.255.255.0 mac-address 0000-5e00-1030 vxlan anycast-gateway enable arp collect host enable # interface Vbdif2040 ip binding vpn-instance vpn1 ip address 192.168.2.1 255.255.255.0 mac-address 0000-5e00-2040 vxlan anycast-gateway enable //对外界声明是一个分布式网关 arp collect host enable //通过arp提取出IP MAC地址等信息放到对应的表项里面 # bgp 123 peer 3.3.3.3 as-number 123 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 Y peer 3.3.3.3 advertise irb # interface Nve1 source 2.2.2.2 vni 1030 head-end peer-list protocol bgp vni 2040 head-end peer-list protocol bgp CE3 evpn-overlay enable bridge-domain 1030 vxlan vni 1030 evpn route-distinguisher 1030:1030 vpn-target 1030:1030 export-extcommunity vpn-target 1234:1234 export-extcommunity vpn-target 1030:1030 import-extcommunity # bridge-domain 2040 vxlan vni 2040 evpn route-distinguisher 2040:2040 vpn-target 2040:2040 export-extcommunity vpn-target 1234:1234 export-extcommunity vpn-target 2040:2040 import-extcommunity # ip vpn-instance vpn1 ipv4-family route-distinguisher 1234:1234 vpn-target 1234:1234 export-extcommunity evpn vpn-target 1234:1234 import-extcommunity evpn vxlan vni 1234 # interface GE1/0/9 undo shutdown # interface GE1/0/9.30 mode l2 encapsulation dot1q vid 30 bridge-domain 1030 # interface GE1/0/9.40 mode l2 encapsulation dot1q vid 40 bridge-domain 2040 # interface Vbdif1030 ip binding vpn-instance vpn1 ip address 192.168.1.1 255.255.255.0 mac-address 0000-5e00-1030 vxlan anycast-gateway enable arp collect host enable # interface Vbdif2040 ip binding vpn-instance vpn1 ip address 192.168.2.1 255.255.255.0 mac-address 0000-5e00-2040 vxlan anycast-gateway enable arp collect host enable # bgp 123 peer 2.2.2.2 as-number 123 peer 2.2.2.2 connect-interface LoopBack0 ipv4-family unicast peer 2.2.2.2 enable l2vpn-family evpn policy vpn-target peer 2.2.2.2 enable Y peer 2.2.2.2 advertise irb # interface Nve1 source 3.3.3.3 vni 1030 head-end peer-list protocol bgp vni 2040 head-end peer-list protocol bgp