拓扑 要求VM1-VM3可以互访 VM2-VM4可以互访
配置文件
Switch A
undo vxlan ip-forwarding
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 20.1.1.0 0.0.0.255
vlan 20
l2vpn enable
vsi vpna
vxlan 10
tunnel 1
tunnel 2
vsi vpnb
vxlan 20
tunnel 1
tunnel 2
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
interface Vlan-interface20
ip address 20.1.1.1 255.255.255.0
interface HundredGigE1/0/1
port link-mode bridge
service-instance 1000
encapsulation s-vid 10
xconnect vsi vpna
service-instance 2000
encapsulation s-vid 11
xconnect vsi vpnb
interface HundredGigE1/0/2
port link-mode bridge
port access vlan 20
interface Tunnel1 mode vxlan
source 1.1.1.1
destination 2.2.2.2
interface Tunnel2 mode vxlan
source 1.1.1.1
destination 3.3.3.3
Switch B
undo vxlan ip-forwarding
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 30.1.1.0 0.0.0.255
vlan 30
l2vpn enable
vsi vpna
vxlan 10
tunnel 1
tunnel 2
vsi vpnb
vxlan 20
tunnel 1
tunnel 2
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
interface Vlan-interface30
ip address 30.1.1.2 255.255.255.0
interface HundredGigE1/0/1
port link-mode bridge
service-instance 1000
encapsulation s-vid 12
xconnect vsi vpna
service-instance 2000
encapsulation s-vid 13
xconnect vsi vpnb
interface HundredGigE1/0/2
port link-mode bridge
port access vlan 30
interface Tunnel1 mode vxlan
source 2.2.2.2
destination 1.1.1.1
interface Tunnel2 mode vxlan
source 2.2.2.2
destination 3.3.3.3
Switch C
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 40.1.1.0 0.0.0.255
ospf 2 router-id 3.3.3.3
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.1.2.0 0.0.0.255
network 100.1.1.0 0.0.0.255
vlan 40
vlan 100
l2vpn enable
vsi vpna
gateway vsi-interface 1
vxlan 10
tunnel 1
tunnel 2
vsi vpnb
gateway vsi-interface 2
vxlan 20
tunnel 1
tunnel 2
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
interface Vlan-interface40
ip address 40.1.1.3 255.255.255.0
interface Vlan-interface100
ip address 100.1.1.1 255.255.255.0
interface HundredGigE1/0/2
port link-mode bridge
port access vlan 40
interface HundredGigE1/0/3
port link-mode bridge
port access vlan 100
interface Vsi-interface1
ip address 10.1.1.1 255.255.255.0
interface Vsi-interface2
ip address 10.1.2.1 255.255.255.0
interface Tunnel1 mode vxlan
source 3.3.3.3
destination 1.1.1.1
interface Tunnel2 mode vxlan
source 3.3.3.3
destination 2.2.2.2
return
Switch D
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 20.1.1.0 0.0.0.255
network 30.1.1.0 0.0.0.255
network 40.1.1.0 0.0.0.255
vlan 20
vlan 30
vlan 40
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
interface Vlan-interface20
ip address 20.1.1.4 255.255.255.0
interface Vlan-interface30
ip address 30.1.1.4 255.255.255.0
interface Vlan-interface40
ip address 40.1.1.4 255.255.255.0
interface HundredGigE1/0/1
port link-mode bridge
port access vlan 20
interface HundredGigE1/0/2
port link-mode bridge
port access vlan 30
interface HundredGigE1/0/3
port link-mode bridge
port access vlan 40
return