• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

VXLAN手动二层转发案例配置

2025-03-06提问
  • 0关注
  • 0收藏,720浏览
粉丝:0人 关注:0人

问题描述:

有案例吗

最佳答案

粉丝:120人 关注:9人

参考官网手册就行 


VXLAN二层转发配置举例

4.1  组网需求

Switch A、Switch B、Switch C为与服务器连接的VTEP设备。虚拟机VM 1、VM 2和VM 3同属于VXLAN 10。通过VXLAN实现不同站点间的二层互联,确保虚拟机在站点之间进行迁移时用户的访问流量不会中断。

图4-1 VXLAN二层转发配置举例

 

4.2  配置思路

·     在IP核心网络上配置路由协议,使得各交换机的接口IP地址(包括Loopback接口IP地址)之间路由可达。本举例以OSPF路由协议为例。

·     在Switch A、Switch B和Switch C之间建立VXLAN隧道,并将VXLAN隧道与VXLAN关联,以便将虚拟机发送的二层报文封装为IP报文后在IP核心网络上转发。

·     在Switch A和Switch B的下行端口上配置以太网服务实例和相应的匹配规则,用来识别用户网络中的报文所属的VXLAN。

4.3  适用产品及版本

表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

不支持

 

4.4  配置注意事项

在VTEP上需要执行undo vxlan ip-forwarding命令,配置VXLAN隧道工作在二层转发模式。

4.5  配置步骤

4.5.1  配置设备工作在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

4.5.2  配置各接口的IP地址

# 配置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地址,配置步骤这里省略。

4.5.3  在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

4.5.4  创建VXLAN

1. 配置Switch A

# 开启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

2. 配置Switch B

# 开启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

3. 配置Switch C

# 开启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

4.5.5  创建VXLAN隧道

# 在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

4.5.6  关联VXLAN和VXLAN隧道

# 在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

4.5.7  配置以太网服务实例匹配用户报文,并将其与VSI关联

# 在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

4.6  验证配置

# 以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  ---

4.7  配置文件

·     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

暂无评论

2 个回答
粉丝:125人 关注:1人

https://www.h3c.com/cn/d_202002/1273747_30005_0.htm

暂无评论

粉丝:32人 关注:1人

3  VXLAN二层转发配置举例

3.1  组网需求

Switch A、Switch B、Switch C为与服务器连接的VTEP设备。虚拟机VM 1、VM 2和VM 3同属于VXLAN 10。通过VXLAN实现不同站点间的二层互联,确保虚拟机在站点之间进行迁移时用户的访问流量不会中断。

图1 VXLAN二层转发配置举例

 

3.2  配置思路

·              在IP核心网络上配置路由协议,使得各交换机的接口IP地址(包括Loopback接口IP地址)之间路由可达。本举例以OSPF路由协议为例。

·              在Switch A、Switch B和Switch C之间建立VXLAN隧道,并将VXLAN隧道与VXLAN关联,以便将虚拟机发送的二层报文封装为IP报文后在IP核心网络上转发。

·              在Switch A和Switch B的下行端口上配置以太网服务实例和相应的匹配规则,用来识别用户网络中的报文所属的VXLAN。

3.3  配置步骤

3.3.1  配置各接口的IP地址

# 配置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地址,配置步骤这里省略。

3.3.2  在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

3.3.3  创建VXLAN

1. 配置Switch A

# 开启L2VPN功能。

[SwitchA] l2vpn enable

# 创建VXLAN 10。

[SwitchA] vsi vpna

[SwitchA-vsi-vpna] vxlan 10

[SwitchA-vsi-vpna-vxlan10] quit

[SwitchA-vsi-vpna] quit

2. 配置Switch B

# 开启L2VPN功能。

[SwitchB] l2vpn enable

# 创建VXLAN 10。

[SwitchB] vsi vpna

[SwitchB-vsi-vpna] vxlan 10

[SwitchB-vsi-vpna-vxlan10] quit

[SwitchB-vsi-vpna] quit

3. 配置Switch C

# 开启L2VPN功能。

[SwitchC] l2vpn enable

# 创建VXLAN 10。

[SwitchC] vsi vpna

[SwitchC-vsi-vpna] vxlan 10

[SwitchC-vsi-vpna-vxlan10] quit

[SwitchC-vsi-vpna] quit

3.3.4  创建VXLAN隧道

# 在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

3.3.5  关联VXLAN和VXLAN隧道

# 在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

3.3.6  配置以太网服务实例匹配用户报文,并将其与VSI关联

# 在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

3.4  验证配置

# 以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  ---

3.5  配置文件

·              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

暂无评论

编辑答案

你正在编辑答案

如果你要对问题或其他回答进行点评或询问,请使用评论功能。

分享扩散:

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作

举报

×

侵犯我的权益 >
对根叔社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明