CE3端口及OSPF配置
system-view immediately [HUAWEI] interface loopback 1
[HUAWEI-LoopBack1] ip address 10.1.1.2 32
[HUAWEI-LoopBack1] quit
[HUAWEI] interface gigabitethernet 1/0/1
[HUAWEI-GigabitEthernet1/0/1] undo portswitch
[HUAWEI-GigabitEthernet1/0/1] undo shutdown
[HUAWEI-GigabitEthernet1/0/1] ip address 192.168.2.1 24
[HUAWEI-GigabitEthernet1/0/1] quit
[HUAWEI] ospf router-id 10.1.1.2
[HUAWEI-ospf-1] area 0
[HUAWEI-ospf-1-area-0.0.0.0] network 10.1.1.2 0.0.0.0
[HUAWEI-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[HUAWEI-ospf-1-area-0.0.0.0] quit
[HUAWEI-ospf-1] quit
CE4端口及OSPF配置
system-view immediately [HUAWEI] interface loopback 1
[HUAWEI-LoopBack1] ip address 10.2.2.2 32
[HUAWEI-LoopBack1] quit
[HUAWEI] interface gigabitethernet 1/0/1
[HUAWEI-GigabitEthernet1/0/1] undo portswitch
[HUAWEI-GigabitEthernet1/0/1] undo shutdown
[HUAWEI-GigabitEthernet1/0/1] ip address 192.168.3.1 24
[HUAWEI-GigabitEthernet1/0/1] quit
[HUAWEI] ospf router-id 10.1.1.2
[HUAWEI-ospf-1] area 0
[HUAWEI-ospf-1-area-0.0.0.0] network 10.2.2.2 0.0.0.0
[HUAWEI-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255
[HUAWEI-ospf-1-area-0.0.0.0] quit
[HUAWEI-ospf-1] quit
CE5端口及OSPF配置
system-view immediately
[HUAWEI] interface loopback 1
[HUAWEI-LoopBack1] ip address 10.3.3.2 32
[HUAWEI-LoopBack1] quit
[HUAWEI] interface gigabitethernet 1/0/1
[HUAWEI-GigabitEthernet1/0/1] undo portswitch
[HUAWEI-GigabitEthernet1/0/1] undo shutdown
[HUAWEI-GigabitEthernet1/0/1] ip address 192.168.2.2 24
[HUAWEI] interface gigabitethernet 1/0/2
[HUAWEI-GigabitEthernet1/0/1] undo portswitch
[HUAWEI-GigabitEthernet1/0/1] undo shutdown
[HUAWEI-GigabitEthernet1/0/1] ip address 192.168.3.2 24
[HUAWEI-GigabitEthernet1/0/1] quit
[HUAWEI] ospf router-id 10.3.3.2
[HUAWEI-ospf-1] area 0
[HUAWEI-ospf-1-area-0.0.0.0] network 10.3.3.2 0.0.0.0
[HUAWEI-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255
[HUAWEI-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[HUAWEI-ospf-1-area-0.0.0.0] quit
[HUAWEI-ospf-1] quit
查看OSPF lsdb表如图
查看路由表信息
# 配置LSW2。
system-view [HUAWEI] vlan 10
[HUAWEI-vlan10] quit
[HUAWEI] interface gigabitethernet 1/0/2
[HUAWEI-GigabitEthernet1/0/2] port link-type access
[HUAWEI-GigabitEthernet1/0/2] port default vlan 10
[HUAWEI-GigabitEthernet1/0/2] quit
[HUAWEI] interface gigabitethernet 1/0/1
[HUAWEI-GigabitEthernet1/0/1] port link-type trunk
[HUAWEI-GigabitEthernet1/0/1] port trunk allow-pass vlan 10
[HUAWEI-GigabitEthernet1/0/1] quit
# 配置LSW3。LSW4同样
system-view [HUAWEI] vlan 10
[HUAWEI-vlan10] quit
[HUAWEI] interface gigabitethernet 1/0/2
[HUAWEI-GigabitEthernet1/0/2] port link-type access
[HUAWEI-GigabitEthernet1/0/2] port default vlan 10
[HUAWEI-GigabitEthernet1/0/2] quit
[HUAWEI] interface gigabitethernet 1/0/1
[HUAWEI-GigabitEthernet1/0/1] port link-type trunk
[HUAWEI-GigabitEthernet1/0/1] port trunk allow-pass vlan 10
[HUAWEI-GigabitEthernet1/0/1] quit
CE3子接口配置
[HUAWEI] bridge-domain 10
[HUAWEI-bd10] quit
[HUAWEI] vcmp role silent
[HUAWEI] interface gigabitethernet 1/0/2
[HUAWEI-GigabitEthernet1/0/2] port link-type trunk
[HUAWEI-GigabitEthernet1/0/2] quit
[HUAWEI] interface gigabitethernet 1/0/2.1 mode l2
[HUAWEI-GigabitEthernet1/0/2.1] encapsulation dot1q vid 10
[HUAWEI-GigabitEthernet1/0/2.1] bridge-domain 10
[HUAWEI-GigabitEthernet1/0/2.1] quit
CE4子接口配置
[HUAWEI] bridge-domain 10
[HUAWEI-bd10] quit
[HUAWEI] vcmp role silent
[HUAWEI] interface gigabitethernet 1/0/2
[HUAWEI-GigabitEthernet1/0/2] port link-type trunk
[HUAWEI-GigabitEthernet1/0/2] quit
[HUAWEI] interface gigabitethernet 1/0/2.1 mode l2
[HUAWEI-GigabitEthernet1/0/2.1] encapsulation dot1q vid 10
[HUAWEI-GigabitEthernet1/0/2.1] bridge-domain 10
[HUAWEI-GigabitEthernet1/0/2.1] quit
在CE3、CE4上配置VXLAN隧道
CE3
[HUAWEI] bridge-domain 10
[HUAWEI-bd10] vxlan vni 10
[HUAWEI-bd10] quit
[HUAWEI] interface nve 1
[HUAWEI-Nve1] source 10.1.1.2
[HUAWEI-Nve1] vni 10 head-end peer-list 10.2.2.2
[HUAWEI-Nve1] quit
CE4
[HUAWEI] bridge-domain 10
[HUAWEI-bd10] vxlan vni 10
[HUAWEI-bd10] quit
[HUAWEI] interface nve 1
[HUAWEI-Nve1] source 10.2.2.2
[HUAWEI-Nve1] vni 10 head-end peer-list 10.1.1.2
[HUAWEI-Nve1] quit
查看vxlan隧道:display vxlan tunnel
查看vni 状态
测试效果