最佳答案
参考官网手册就行
Switch A、Switch B、Switch C为与服务器连接的VTEP设备。虚拟机VM 1、VM 2和VM 3同属于VXLAN 10。通过VXLAN实现不同站点间的二层互联,确保虚拟机在站点之间进行迁移时用户的访问流量不会中断。
图4-1 VXLAN二层转发配置举例
· 在IP核心网络上配置路由协议,使得各交换机的接口IP地址(包括Loopback接口IP地址)之间路由可达。本举例以OSPF路由协议为例。
· 在Switch A、Switch B和Switch C之间建立VXLAN隧道,并将VXLAN隧道与VXLAN关联,以便将虚拟机发送的二层报文封装为IP报文后在IP核心网络上转发。
· 在Switch A和Switch B的下行端口上配置以太网服务实例和相应的匹配规则,用来识别用户网络中的报文所属的VXLAN。
表4-1 适用产品及版本
产品 | 软件版本 |
S6812系列 S6813系列 | Release 6615Pxx系列、Release 6628Pxx系列 |
S6550XE-HI系列 | Release 6008及以上版本、Release 8106Pxx |
S6525XE-HI系列 | Release 6008及以上版本、Release 8106Pxx |
S5850系列 | 不支持 |
S5570S-EI系列 | 不支持 |
S5560X-EI系列 | Release 63xx系列、Release 65xx系列、Release 6615Pxx系列、Release 6628Pxx系列 |
S5560X-HI系列 | Release 63xx系列、Release 65xx系列、Release 6615Pxx系列、Release 6628Pxx系列 |
S5500V2-EI系列 | Release 63xx系列、Release 65xx系列、Release 6615Pxx系列、Release 6628Pxx系列 |
MS4520V2-30F | Release 63xx系列、Release 65xx系列、Release 6615Pxx系列、Release 6628Pxx系列 |
MS4520V2-30C MS4520V2-54C | Release 65xx系列、Release 6615Pxx系列、Release 6628Pxx系列 |
MS4520V2-28S MS4520V2-24TP | Release 63xx系列 |
S6520X-HI系列 S6520X-EI系列 | Release 63xx系列、Release 65xx系列、Release 6615Pxx系列、Release 6628Pxx系列 |
S6520X-SI系列 S6520-SI系列 | Release 63xx系列、Release 65xx系列、Release 6615Pxx系列、Release 6628Pxx系列 |
S5000-EI系列 | Release 63xx系列、Release 65xx系列、Release 6615Pxx系列、Release 6628Pxx系列 |
MS4600系列 | Release 63xx系列、Release 65xx系列、Release 6615Pxx系列、Release 6628Pxx系列 |
ES5500系列 | Release 63xx系列、Release 65xx系列、Release 6615Pxx系列、Release 6628Pxx系列 |
S5560S-EI系列 S5560S-SI系列 | 不支持 |
S5500V3-24P-SI S5500V3-48P-SI | 不支持 |
S5500V3-SI系列(除S5500V3-24P-SI、S5500V3-48P-SI) | 不支持 |
S5170-EI系列 | 不支持 |
S5130S-HI系列 S5130S-EI[-R]系列 S5130S-SI系列 S5130S-LI系列 | 不支持 |
S5120V2-SI系列 S5120V2-LI系列 | 不支持 |
S5120V3-EI系列 | 不支持 |
S5120V3-36F-SI S5120V3-28P-HPWR-SI S5120V3-54P-PWR-SI | 不支持 |
S5120V3-SI系列(除S5120V3-36F-SI、S5120V3-28P-HPWR-SI、S5120V3-54P-PWR-SI) | 不支持 |
S5120V3-LI系列 | 不支持 |
S3600V3-EI系列 | 不支持 |
S3600V3-SI系列 | 不支持 |
S3100V3-EI系列 S3100V3-SI系列 | 不支持 |
S5110V2系列 | 不支持 |
S5110V2-SI系列 | 不支持 |
S5000V3-EI系列 S5000V5-EI系列 | 不支持 |
S5000E-X系列 S5000X-EI系列 | 不支持 |
E128C E152C E500C系列 E500D系列 | 不支持 |
MS4320V2系列 MS4320V3系列 MS4300V2系列 MS4320系列 MS4200系列 | 不支持 |
WS5850-WiNet系列 | 不支持 |
WS5820-WiNet系列 WS5810-WiNet系列 | 不支持 |
WAS6000系列 | 不支持 |
IE4300-12P-AC & IE4300-12P-PWR IE4300-M系列 IE4320系列 | 不支持 |
IE4520系列 | Release 66xx系列 |
S5135S-EI | 不支持 |
在VTEP上需要执行undo vxlan ip-forwarding命令,配置VXLAN隧道工作在二层转发模式。
# 配置Switch A、Switch B和Switch C工作在VXLAN模式,保存配置并重启设备。以Switch A为例,其他设备的配置方法与此相同。(S6550XE-HI和S6525XE-HI系列交换机无需执行本步骤)
<SwitchA> system-view
[SwitchA] switch-mode 1
Reboot device to make the configuration take effect.
[SwitchA] quit
<SwitchA> reboot
Start to check configuration with next startup configuration file, please wait..
.......DONE!
Current configuration may be lost after the reboot, save current configuration?
[Y/N]:y
This command will reboot the device. Continue? [Y/N]:y
# 配置Switch A的接口IP地址。
<SwitchA> system-view
[SwitchA] vlan 11
[SwitchA-vlan11] port gigabitethernet 1/0/2
[SwitchA-vlan11] quit
[SwitchA] interface vlan-interface 11
[SwitchA-Vlan-interface11] ip address 11.1.1.1 24
[SwitchA-Vlan-interface11] quit
[SwitchA] interface loopback 0
[SwitchA-LoopBack0] ip address 1.1.1.1 32
# 请参考以上方法配置其它设备上的接口IP地址,配置步骤这里省略。
# 在Switch A上配置OSPF发布接口所在网段的路由。
[SwitchA] ospf 1 router-id 1.1.1.1
[SwitchA-ospf-1] area 0
[SwitchA-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[SwitchA-ospf-1-area-0.0.0.0] network 11.1.1.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] quit
# 在Switch B上配置OSPF发布接口所在网段的路由。
[SwitchB] ospf 1 router-id 2.2.2.2
[SwitchB-ospf-1] area 0
[SwitchB-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[SwitchB-ospf-1-area-0.0.0.0] network 12.1.1.0 0.0.0.255
[SwitchB-ospf-1-area-0.0.0.0] quit
[SwitchB-ospf-1] quit
# 在Switch C上配置OSPF发布接口所在网段的路由。
[SwitchC] ospf 1 router-id 3.3.3.3
[SwitchC-ospf-1] area 0
[SwitchC-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[SwitchC-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255
[SwitchC-ospf-1-area-0.0.0.0] quit
[SwitchC-ospf-1] quit
# 在Switch D上配置OSPF发布接口所在网段的路由。
[SwitchD] ospf 1 router-id 4.4.4.4
[SwitchD-ospf-1] area 0
[SwitchD-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0
[SwitchD-ospf-1-area-0.0.0.0] network 11.1.1.0 0.0.0.255
[SwitchD-ospf-1-area-0.0.0.0] network 12.1.1.0 0.0.0.255
[SwitchD-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255
[SwitchD-ospf-1-area-0.0.0.0] quit
[SwitchD-ospf-1] quit
# 开启L2VPN功能。
[SwitchA] l2vpn enable
# 配置VXLAN隧道工作在二层转发模式。(S6550XE-HI和S6525XE-HI系列交换机无需执行本步骤)
[SwitchA] undo vxlan ip-forwarding
# 创建VXLAN 10。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] vxlan 10
[SwitchA-vsi-vpna-vxlan10] quit
[SwitchA-vsi-vpna] quit
# 开启L2VPN功能。
[SwitchB] l2vpn enable
# 配置VXLAN隧道工作在二层转发模式。(S6550XE-HI和S6525XE-HI系列交换机无需执行本步骤)
[SwitchB] undo vxlan ip-forwarding
# 创建VXLAN 10。
[SwitchB] vsi vpna
[SwitchB-vsi-vpna] vxlan 10
[SwitchB-vsi-vpna-vxlan10] quit
[SwitchB-vsi-vpna] quit
# 开启L2VPN功能。
[SwitchC] l2vpn enable
# 配置VXLAN隧道工作在二层转发模式。(S6550XE-HI和S6525XE-HI系列交换机无需执行本步骤)
[SwitchC] undo vxlan ip-forwarding
# 创建VXLAN 10。
[SwitchC] vsi vpna
[SwitchC-vsi-vpna] vxlan 10
[SwitchC-vsi-vpna-vxlan10] quit
[SwitchC-vsi-vpna] quit
# 在Switch A上创建到达Switch B和Switch C的VXLAN隧道Tunnel1和Tunnel2。
[SwitchA] interface tunnel 1 mode vxlan
[SwitchA-Tunnel1] source 1.1.1.1
[SwitchA-Tunnel1] destination 2.2.2.2
[SwitchA-Tunnel1] quit
[SwitchA] interface tunnel 2 mode vxlan
[SwitchA-Tunnel2] source 1.1.1.1
[SwitchA-Tunnel2] destination 3.3.3.3
[SwitchA-Tunnel2] quit
# 在Switch B上创建到达Switch A和Switch C的VXLAN隧道Tunnel1和Tunnel2。
[SwitchB] interface tunnel 1 mode vxlan
[SwitchB-Tunnel1] source 2.2.2.2
[SwitchB-Tunnel1] destination 1.1.1.1
[SwitchB-Tunnel1] quit
[SwitchB] interface tunnel 2 mode vxlan
[SwitchB-Tunnel2] source 2.2.2.2
[SwitchB-Tunnel2] destination 3.3.3.3
[SwitchB-Tunnel2] quit
# 在Switch C上创建到达Switch A和Switch B的VXLAN隧道Tunnel1和Tunnel2。
[SwitchC] interface tunnel 1 mode vxlan
[SwitchC-Tunnel1] source 3.3.3.3
[SwitchC-Tunnel1] destination 1.1.1.1
[SwitchC-Tunnel1] quit
[SwitchC] interface tunnel 2 mode vxlan
[SwitchC-Tunnel2] source 3.3.3.3
[SwitchC-Tunnel2] destination 2.2.2.2
[SwitchC-Tunnel2] quit
# 在Switch A上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10关联。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] vxlan 10
[SwitchA-vsi-vpna-vxlan10] tunnel 1
[SwitchA-vsi-vpna-vxlan10] tunnel 2
[SwitchA-vsi-vpna-vxlan10] quit
[SwitchA-vsi-vpna] quit
# 在Switch B上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10关联。
[SwitchB] vsi vpna
[SwitchB-vsi-vpna] vxlan 10
[SwitchB-vsi-vpna-vxlan10] tunnel 1
[SwitchB-vsi-vpna-vxlan10] tunnel 2
[SwitchB-vsi-vpna-vxlan10] quit
[SwitchB-vsi-vpna] quit
# 在Switch C上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10关联。
[SwitchC] vsi vpna
[SwitchC-vsi-vpna] vxlan 10
[SwitchC-vsi-vpna-vxlan10] tunnel 1
[SwitchC-vsi-vpna-vxlan10] tunnel 2
[SwitchC-vsi-vpna-vxlan10] quit
[SwitchC-vsi-vpna] quit
# 在Switch A的接口GigabitEthernet1/0/1上创建以太网服务实例1000,该实例用来匹配VLAN 2(VM 1)的数据帧,将该服务实例与vpna(VXLAN 10)关联。
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type trunk
[SwitchA-GigabitEthernet1/0/1] port trunk permit vlan 2
[SwitchA-GigabitEthernet1/0/1] service-instance 1000
[SwitchA-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 2
[SwitchA-GigabitEthernet1/0/1-srv1000] xconnect vsi vpna
[SwitchA-GigabitEthernet1/0/1-srv1000] quit
[SwitchA-GigabitEthernet1/0/1] quit
# 在Switch B的接口GigabitEthernet1/0/1上创建以太网服务实例1000,该实例用来匹配VLAN 2(VM 2)的数据帧,将该服务实例与vpna(VXLAN 10)关联。
[SwitchB] interface gigabitethernet 1/0/1
[SwitchB-GigabitEthernet1/0/1] port link-type trunk
[SwitchB-GigabitEthernet1/0/1] port trunk permit vlan 2
[SwitchB-GigabitEthernet1/0/1] service-instance 1000
[SwitchB-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 2
[SwitchB-GigabitEthernet1/0/1-srv1000] xconnect vsi vpna
[SwitchB-GigabitEthernet1/0/1-srv1000] quit
[SwitchB-GigabitEthernet1/0/1] quit
# 在Switch C的接口GigabitEthernet1/0/1上创建以太网服务实例1000,该实例用来匹配VLAN 2(VM 3)的数据帧,将该服务实例与vpna(VXLAN 10)关联。
[SwitchC] interface gigabitethernet 1/0/1
[SwitchC-GigabitEthernet1/0/1] port link-type trunk
[SwitchC-GigabitEthernet1/0/1] port trunk permit vlan 2
[SwitchC-GigabitEthernet1/0/1] service-instance 1000
[SwitchC-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 2
[SwitchC-GigabitEthernet1/0/1-srv1000] xconnect vsi vpna
[SwitchC-GigabitEthernet1/0/1-srv1000] quit
[SwitchC-GigabitEthernet1/0/1] quit
# 以Switch A为例,查看Tunnel接口信息,可以看到VXLAN模式的Tunnel接口处于up状态。
[SwitchA] display interface tunnel
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 1.1.1.1, destination 2.2.2.2
Tunnel protocol/transport UDP_VXLAN/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
Tunnel2
Current state: UP
Line protocol state: UP
Description: Tunnel2 Interface
Bandwidth: 64kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 1.1.1.1, destination 3.3.3.3
Tunnel protocol/transport UDP_VXLAN/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 以Switch A为例,查看VSI信息,可以看到与VXLAN关联的VXLAN隧道、与VSI关联的以太网服务实例均处于up状态。
[SwitchA] display l2vpn vsi verbose
VSI Name: vpna
VSI Index : 0
VSI State : Up
MTU : 1500
Bandwidth : -
Broadcast Restrain : -
Multicast Restrain : -
Unknown Unicast Restrain: -
MAC Learning : Enabled
MAC Table Limit : -
MAC Learning rate : -
Drop Unknown : -
Flooding : Enabled
Statistics : Disabled
VXLAN ID : 10
Tunnels:
Tunnel Name Link ID State Type Flood proxy
Tunnel1 0x5000001 Up Manual Disabled
Tunnel2 0x5000002 Up Manual Disabled
ACs:
AC Link ID State Type
GE1/0/1 srv1000 0 Up Manual
# 虚拟机VM 1、VM 2、VM 3之间可以互相ping通。
# 以Switch A为例,查看VSI的MAC地址表项信息,可以看到已学习到的MAC地址信息。
[SwitchA] display l2vpn mac-address
MAC Address State VSI Name Link ID/Name Aging
cc3e-5f9c-6cdb Dynamic vpna Tunnel1 Aging
cc3e-5f9c-23dc Dynamic vpna Tunnel2 Aging
--- 2 mac address(es) found ---
· Switch A
#
undo vxlan ip-forwarding (S6550XE-HI和S6525XE-HI系列交换机无此配置)
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 11.1.1.0 0.0.0.255
#
vlan 2
#
vlan 11
#
l2vpn enable
#
vsi vpna
vxlan 10
tunnel 1
tunnel 2
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface Vlan-interface11
ip address 11.1.1.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 to 2
#
service-instance 1000
encapsulation s-vid 2
xconnect vsi vpna
#
interface GigabitEthernet1/0/2
port link-mode bridge
port access vlan 11
#
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
#
return
· Switch B
#
undo vxlan ip-forwarding(S6550XE-HI和S6525XE-HI系列交换机无此配置)
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 12.1.1.0 0.0.0.255
#
vlan 2
#
vlan 12
#
l2vpn enable
#
vsi vpna
vxlan 10
tunnel 1
tunnel 2
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface Vlan-interface12
ip address 12.1.1.2 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 to 2
#
service-instance 1000
encapsulation s-vid 2
xconnect vsi vpna
#
interface GigabitEthernet1/0/2
port link-mode bridge
port access vlan 12
#
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
#
return
· Switch C
#
undo vxlan ip-forwarding(S6550XE-HI和S6525XE-HI系列交换机无此配置)
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 13.1.1.0 0.0.0.255
#
vlan 2
#
vlan 13
#
l2vpn enable
#
vsi vpna
vxlan 10
tunnel 1
tunnel 2
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
interface Vlan-interface13
ip address 13.1.1.3 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 to 2
#
service-instance 1000
encapsulation s-vid 2
xconnect vsi vpna
#
interface GigabitEthernet1/0/2
port link-mode bridge
port access vlan 13
#
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 11.1.1.0 0.0.0.255
network 12.1.1.0 0.0.0.255
network 13.1.1.0 0.0.0.255
#
vlan 11
#
vlan 12
#
vlan 13
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
#
interface Vlan-interface11
ip address 11.1.1.4 255.255.255.0
#
interface Vlan-interface12
ip address 12.1.1.4 255.255.255.0
#
interface Vlan-interface13
ip address 13.1.1.4 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-mode bridge
port access vlan 11
#
interface GigabitEthernet1/0/2
port link-mode bridge
port access vlan 12
#
interface GigabitEthernet1/0/3
port link-mode bridge
port access vlan 13
#
return
(0)
Switch A、Switch B、Switch C为与服务器连接的VTEP设备。虚拟机VM 1、VM 2和VM 3同属于VXLAN 10。通过VXLAN实现不同站点间的二层互联,确保虚拟机在站点之间进行迁移时用户的访问流量不会中断。
图1 VXLAN二层转发配置举例
· 在IP核心网络上配置路由协议,使得各交换机的接口IP地址(包括Loopback接口IP地址)之间路由可达。本举例以OSPF路由协议为例。
· 在Switch A、Switch B和Switch C之间建立VXLAN隧道,并将VXLAN隧道与VXLAN关联,以便将虚拟机发送的二层报文封装为IP报文后在IP核心网络上转发。
· 在Switch A和Switch B的下行端口上配置以太网服务实例和相应的匹配规则,用来识别用户网络中的报文所属的VXLAN。
# 配置Switch A的接口IP地址。
<SwitchA> system-view
[SwitchA] vlan 11
[SwitchA-vlan11] port ten-gigabitethernet 1/0/2
[SwitchA-vlan11] quit
[SwitchA] interface vlan-interface 11
[SwitchA-Vlan-interface11] ip address 11.1.1.1 24
[SwitchA-Vlan-interface11] quit
[SwitchA] interface loopback 0
[SwitchA-LoopBack0] ip address 1.1.1.1 32
# 请参考以上方法配置其它设备上的接口IP地址,配置步骤这里省略。
# 在Switch A上配置OSPF发布接口所在网段的路由。
[SwitchA] ospf 1 router-id 1.1.1.1
[SwitchA-ospf-1] area 0
[SwitchA-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[SwitchA-ospf-1-area-0.0.0.0] network 11.1.1.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] quit
# 在Switch B上配置OSPF发布接口所在网段的路由。
[SwitchB] ospf 1 router-id 2.2.2.2
[SwitchB-ospf-1] area 0
[SwitchB-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[SwitchB-ospf-1-area-0.0.0.0] network 12.1.1.0 0.0.0.255
[SwitchB-ospf-1-area-0.0.0.0] quit
[SwitchB-ospf-1] quit
# 在Switch C上配置OSPF发布接口所在网段的路由。
[SwitchC] ospf 1 router-id 3.3.3.3
[SwitchC-ospf-1] area 0
[SwitchC-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[SwitchC-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255
[SwitchC-ospf-1-area-0.0.0.0] quit
[SwitchC-ospf-1] quit
# 在Switch D上配置OSPF发布接口所在网段的路由。
[SwitchD] ospf 1 router-id 4.4.4.4
[SwitchD-ospf-1] area 0
[SwitchD-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0
[SwitchD-ospf-1-area-0.0.0.0] network 11.1.1.0 0.0.0.255
[SwitchD-ospf-1-area-0.0.0.0] network 12.1.1.0 0.0.0.255
[SwitchD-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255
[SwitchD-ospf-1-area-0.0.0.0] quit
[SwitchD-ospf-1] quit
# 开启L2VPN功能。
[SwitchA] l2vpn enable
# 创建VXLAN 10。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] vxlan 10
[SwitchA-vsi-vpna-vxlan10] quit
[SwitchA-vsi-vpna] quit
# 开启L2VPN功能。
[SwitchB] l2vpn enable
# 创建VXLAN 10。
[SwitchB] vsi vpna
[SwitchB-vsi-vpna] vxlan 10
[SwitchB-vsi-vpna-vxlan10] quit
[SwitchB-vsi-vpna] quit
# 开启L2VPN功能。
[SwitchC] l2vpn enable
# 创建VXLAN 10。
[SwitchC] vsi vpna
[SwitchC-vsi-vpna] vxlan 10
[SwitchC-vsi-vpna-vxlan10] quit
[SwitchC-vsi-vpna] quit
# 在Switch A上创建到达Switch B和Switch C的VXLAN隧道Tunnel1和Tunnel2。
[SwitchA] interface tunnel 1 mode vxlan
[SwitchA-Tunnel1] source 1.1.1.1
[SwitchA-Tunnel1] destination 2.2.2.2
[SwitchA-Tunnel1] quit
[SwitchA] interface tunnel 2 mode vxlan
[SwitchA-Tunnel2] source 1.1.1.1
[SwitchA-Tunnel2] destination 3.3.3.3
[SwitchA-Tunnel2] quit
# 在Switch B上创建到达Switch A和Switch C的VXLAN隧道Tunnel1和Tunnel2。
[SwitchB] interface tunnel 1 mode vxlan
[SwitchB-Tunnel1] source 2.2.2.2
[SwitchB-Tunnel1] destination 1.1.1.1
[SwitchB-Tunnel1] quit
[SwitchB] interface tunnel 2 mode vxlan
[SwitchB-Tunnel2] source 2.2.2.2
[SwitchB-Tunnel2] destination 3.3.3.3
[SwitchB-Tunnel2] quit
# 在Switch C上创建到达Switch A和Switch B的VXLAN隧道Tunnel1和Tunnel2。
[SwitchC] interface tunnel 1 mode vxlan
[SwitchC-Tunnel1] source 3.3.3.3
[SwitchC-Tunnel1] destination 1.1.1.1
[SwitchC-Tunnel1] quit
[SwitchC] interface tunnel 2 mode vxlan
[SwitchC-Tunnel2] source 3.3.3.3
[SwitchC-Tunnel2] destination 2.2.2.2
[SwitchC-Tunnel2] quit
# 在Switch A上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10关联。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] vxlan 10
[SwitchA-vsi-vpna-vxlan10] tunnel 1
[SwitchA-vsi-vpna-vxlan10] tunnel 2
[SwitchA-vsi-vpna-vxlan10] quit
[SwitchA-vsi-vpna] quit
# 在Switch B上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10关联。
[SwitchB] vsi vpna
[SwitchB-vsi-vpna] vxlan 10
[SwitchB-vsi-vpna-vxlan10] tunnel 1
[SwitchB-vsi-vpna-vxlan10] tunnel 2
[SwitchB-vsi-vpna-vxlan10] quit
[SwitchB-vsi-vpna] quit
# 在Switch C上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10关联。
[SwitchC] vsi vpna
[SwitchC-vsi-vpna] vxlan 10
[SwitchC-vsi-vpna-vxlan10] tunnel 1
[SwitchC-vsi-vpna-vxlan10] tunnel 2
[SwitchC-vsi-vpna-vxlan10] quit
[SwitchC-vsi-vpna] quit
# 在Switch A的接口Ten-GigabitEthernet1/0/1上创建以太网服务实例1000,该实例用来匹配VLAN 2(VM 1)的数据帧,将该服务实例与vpna(VXLAN 10)关联。
[SwitchA] interface ten-gigabitethernet 1/0/1
[SwitchA-Ten-GigabitEthernet1/0/1] service-instance 1000
[SwitchA-Ten-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 2
[SwitchA-Ten-GigabitEthernet1/0/1-srv1000] xconnect vsi vpna
[SwitchA-Ten-GigabitEthernet1/0/1-srv1000] quit
[SwitchA-Ten-GigabitEthernet1/0/1] quit
# 在Switch B的接口Ten-GigabitEthernet1/0/1上创建以太网服务实例1000,该实例用来匹配VLAN 2(VM 2)的数据帧,将该服务实例与vpna(VXLAN 10)关联。
[SwitchB] interface ten-gigabitethernet 1/0/1
[SwitchB-Ten-GigabitEthernet1/0/1] service-instance 1000
[SwitchB-Ten-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 2
[SwitchB-Ten-GigabitEthernet1/0/1-srv1000] xconnect vsi vpna
[SwitchB-Ten-GigabitEthernet1/0/1-srv1000] quit
[SwitchB-Ten-GigabitEthernet1/0/1] quit
# 在Switch C的接口Ten-GigabitEthernet1/0/1上创建以太网服务实例1000,该实例用来匹配VLAN 2(VM 3)的数据帧,将该服务实例与vpna(VXLAN 10)关联。
[SwitchC] interface ten-gigabitethernet 1/0/1
[SwitchC-Ten-GigabitEthernet1/0/1] service-instance 1000
[SwitchC-Ten-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 2
[SwitchC-Ten-GigabitEthernet1/0/1-srv1000] xconnect vsi vpna
[SwitchC-Ten-GigabitEthernet1/0/1-srv1000] quit
[SwitchC-Ten-GigabitEthernet1/0/1] quit
# 以Switch A为例,查看Tunnel接口信息,可以看到VXLAN模式的Tunnel接口处于up状态。
[SwitchA] display interface tunnel
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 1.1.1.1, destination 2.2.2.2
Tunnel protocol/transport UDP_VXLAN/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
Tunnel2
Current state: UP
Line protocol state: UP
Description: Tunnel2 Interface
Bandwidth: 64kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 1.1.1.1, destination 3.3.3.3
Tunnel protocol/transport UDP_VXLAN/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 以Switch A为例,查看VSI信息,可以看到与VXLAN关联的VXLAN隧道、与VSI关联的以太网服务实例均处于up状态。
[SwitchA] display l2vpn vsi verbose
VSI Name: vpna
VSI Index : 0
VSI State : Up
MTU : 1500
Bandwidth : -
Broadcast Restrain : -
Multicast Restrain : -
Unknown Unicast Restrain: -
MAC Learning : Enabled
MAC Table Limit : -
MAC Learning rate : -
Drop Unknown : -
Flooding : Enabled
Statistics : Disabled
VXLAN ID : 10
Tunnels:
Tunnel Name Link ID State Type Flood proxy
Tunnel1 0x5000001 Up Manual Disabled
Tunnel2 0x5000002 Up Manual Disabled
ACs:
AC Link ID State Type
XGE1/0/1 srv1000 0 Up Manual
# 虚拟机VM 1、VM 2、VM 3之间可以互相ping通。
# 以Switch A为例,查看VSI的MAC地址表项信息,可以看到已学习到的MAC地址信息。
[SwitchA] display l2vpn mac-address
MAC Address State VSI Name Link ID/Name Aging
cc3e-5f9c-6cdb Dynamic vpna Tunnel1 Aging
cc3e-5f9c-23dc Dynamic vpna Tunnel2 Aging
--- 2 mac address(es) found ---
· Switch A
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 11.1.1.0 0.0.0.255
#
vlan 2
#
vlan 12
#
l2vpn enable
#
vsi vpna
vxlan 10
tunnel 1
tunnel 2
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface Vlan-interface11
ip address 11.1.1.1 255.255.255.0
#
interface Ten-GigabitEthernet1/0/1
port link-mode bridge
service-instance 1000
encapsulation s-vid 2
xconnect vsi vpna
#
interface Ten-GigabitEthernet1/0/2
port link-mode bridge
port access vlan 11
#
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
#
return
· Switch B
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 12.1.1.0 0.0.0.255
#
vlan 2
#
vlan 11
#
l2vpn enable
#
vsi vpna
vxlan 10
tunnel 1
tunnel 2
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface Vlan-interface12
ip address 12.1.1.2 255.255.255.0
#
interface Ten-GigabitEthernet1/0/1
port link-mode bridge
service-instance 1000
encapsulation s-vid 2
xconnect vsi vpna
#
interface Ten-GigabitEthernet1/0/2
port link-mode bridge
port access vlan 12
#
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
#
return
· 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 13.1.1.0 0.0.0.255
#
vlan 2
#
vlan 13
#
l2vpn enable
#
vsi vpna
vxlan 10
tunnel 1
tunnel 2
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
interface Vlan-interface13
ip address 13.1.1.3 255.255.255.0
#
interface Ten-GigabitEthernet1/0/1
port link-mode bridge
service-instance 1000
encapsulation s-vid 2
xconnect vsi vpna
#
interface Ten-GigabitEthernet1/0/2
port link-mode bridge
port access vlan 13
#
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 11.1.1.0 0.0.0.255
network 12.1.1.0 0.0.0.255
network 13.1.1.0 0.0.0.255
#
vlan 11
#
vlan 12
#
vlan 13
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
#
interface Vlan-interface11
ip address 11.1.1.4 255.255.255.0
#
interface Vlan-interface12
ip address 12.1.1.4 255.255.255.0
#
interface Vlan-interface13
ip address 13.1.1.4 255.255.255.0
#
interface Ten-GigabitEthernet1/0/1
port link-mode bridge
port access vlan 11
#
interface Ten-GigabitEthernet1/0/2
port link-mode bridge
port access vlan 12
#
interface Ten-GigabitEthernet1/0/3
port link-mode bridge
port access vlan 13
#
return
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论