0 基础网络配置
IP Address / OSPF
1 BGP / RR
for CE1
bgp 200 undo default ipv4-unicast peer 10.0.0.2 as-number 200 peer 10.0.0.2 connect-interface LoopBack0 peer 10.0.0.3 as-number 200 peer 10.0.0.3 connect-interface LoopBack0 # ipv4-family unicast undo peer 10.0.0.2 enable undo peer 10.0.0.3 enable # l2vpn-family evpn undo policy vpn-target peer 10.0.0.2 enable peer 10.0.0.2 advertise irb peer 10.0.0.2 reflect-client peer 10.0.0.3 enable peer 10.0.0.3 advertise irb peer 10.0.0.3 reflect-client
for CE2
bgp 200 undo default ipv4-unicast peer 10.0.0.1 as-number 200 peer 10.0.0.1 connect-interface LoopBack0 # ipv4-family unicast undo peer 10.0.0.1 enable # l2vpn-family evpn policy vpn-target peer 10.0.0.1 enable peer 10.0.0.1 advertise irb
for CE3
与 CE2 类似,略;
2 Bridge Domain
for CE2
ip vpn-instance vxlan ipv4-family route-distinguisher 523:1 vpn-target 300523:1 export-extcommunity vpn-target 300523:1 export-extcommunity evpn vpn-target 300523:1 import-extcommunity vpn-target 300523:1 import-extcommunity evpn vxlan vni 5010 # bridge-domain 368 vxlan vni 7522 evpn route-distinguisher 368:1 vpn-target 368:1 export-extcommunity vpn-target 300523:1 export-extcommunity vpn-target 368:1 import-extcommunity # bridge-domain 523 vxlan vni 1458 evpn route-distinguisher 523:1 vpn-target 523:1 export-extcommunity vpn-target 300523:1 export-extcommunity vpn-target 523:1 import-extcommunity // -------------------------------------------------------- // Vbdif interface Vbdif368 ip binding vpn-instance vxlan ip address 192.168.20.254 255.255.255.0 mac-address 0000-005e-0002 vxlan anycast-gateway enable arp collect host enable # interface Vbdif523 ip binding vpn-instance vxlan ip address 192.168.10.254 255.255.255.0 mac-address 0000-005e-0001 vxlan anycast-gateway enable arp collect host enable
for CE3
与 CE2 类似,略;
3 Interface Nve
for CE2
interface Nve1 source 10.0.0.2 vni 1458 head-end peer-list protocol bgp vni 7522 head-end peer-list protocol bgp
for CE3
与 CE2 类似,略;
4 配置设备接入
for CE2
interface GE1/0/1 undo shutdown # interface GE1/0/1.1 mode l2 encapsulation dot1q vid 121 bridge-domain 523 # interface GE1/0/2 undo shutdown # interface GE1/0/2.1 mode l2 encapsulation dot1q vid 122 // --------------------------- // 在模拟器中,其他接入方式多少都存在问题 bridge-domain 523
for CE3
与 CE2 类似,略;
5 ping 测试
[PC1] ping PC3
[PC2] ping PC3
[PC4] ping PC3
[PC1] ping PC4
补充说明
Q:在什么要在拓扑中使用交换机?
A:我们尝试将 PC 直接接入 CE 设备,但是 ping 测试无法得到响应;