• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C S12500R系列交换路由器 典型配置举例-Release 36xx系列-6W100

目录

57-VXLAN典型配置举例

本章节下载 57-VXLAN典型配置举例  (380.78 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S12500/S12500R/Configure/Typical_Configuration_Example/H3C_S12500R_CE_36xx/202104/1400535_30005_0.htm

57-VXLAN典型配置举例

 

H3C S12500R产品VXLAN配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2021 新华三技术有限公司 版权所有,保留一切权利。

非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。

除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。

本文档中的信息可能变动,恕不另行通知。



1  简介

本文档介绍VXLAN(Virtual eXtensible LAN,可扩展虚拟局域网络)的典型配置案例。VXLAN是基于IP网络、采用“MAC in UDP”封装形式的二层VPN技术。VXLAN可以基于已有的服务提供商或企业IP网络,为分散的物理站点提供二层互联,并能够为不同的租户提供业务隔离。VXLAN主要应用于数据中心网络。

2  配置前提

本文档不严格与具体软、硬件版本对应,如果使用过程中与产品实际情况有差异,请以设备实际情况为准。

本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。

本文档假设您已了解VXLAN特性。

3  使用限制

VXLAN功能受设备的工作模式限制,在使用VXLAN功能前,请在系统视图下使用“system-working-mode standard”命令将设备设置为标准模式。需要注意的是,使用该命令修改设备的工作模式时,需要保存设备当前配置文件,然后重启设备后才能生效。

4  VXLAN二层转发配置举例

4.1  组网需求

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

图1 VXLAN二层转发配置举例

 

4.2  配置思路

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

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

·     在Router A和Router B的下行端口上配置接口关联的VSI,用来识别用户网络中的报文所属的VXLAN。

4.3  使用版本

本举例是在R3606版本上进行配置和验证的。

4.4  配置注意事项

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

缺省情况下,接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。

4.5  配置步骤

4.5.1  配置各接口的IP地址

# 配置Router A的接口IP地址。

<RouterA> system-view

[RouterA] interface hundredgige 1/0/2

[RouterA-HundredGigE1/0/2] ip address 11.1.1.1 24

[RouterA-HundredGigE1/0/2] quit

[RouterA] interface loopback 0

[RouterA-LoopBack0] ip address 1.1.1.1 32

# 请参考以上方法配置其它设备上的接口IP地址,配置步骤这里省略。

4.5.2  在IP核心网络上配置路由协议

# 在Router A上配置OSPF发布接口所在网段的路由。

[RouterA] ospf 1 router-id 1.1.1.1

[RouterA-ospf-1] area 0

[RouterA-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0

[RouterA-ospf-1-area-0.0.0.0] network 11.1.1.0 0.0.0.255

[RouterA-ospf-1-area-0.0.0.0] quit

[RouterA-ospf-1] quit

# 在Router B上配置OSPF发布接口所在网段的路由。

[RouterB] ospf 1 router-id 2.2.2.2

[RouterB-ospf-1] area 0

[RouterB-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0

[RouterB-ospf-1-area-0.0.0.0] network 12.1.1.0 0.0.0.255

[RouterB-ospf-1-area-0.0.0.0] quit

[RouterB-ospf-1] quit

# 在Router C上配置OSPF发布接口所在网段的路由。

[RouterC] ospf 1 router-id 3.3.3.3

[RouterC-ospf-1] area 0

[RouterC-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0

[RouterC-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255

[RouterC-ospf-1-area-0.0.0.0] quit

[RouterC-ospf-1] quit

# 在Router D上配置OSPF发布接口所在网段的路由。

[RouterD] ospf 1 router-id 4.4.4.4

[RouterD-ospf-1] area 0

[RouterD-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0

[RouterD-ospf-1-area-0.0.0.0] network 11.1.1.0 0.0.0.255

[RouterD-ospf-1-area-0.0.0.0] network 12.1.1.0 0.0.0.255

[RouterD-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255

[RouterD-ospf-1-area-0.0.0.0] quit

[RouterD-ospf-1] quit

4.5.3  创建VXLAN

1. 配置Router A

# 开启L2VPN功能。

[RouterA] l2vpn enable

# 配置VXLAN隧道工作在二层转发模式。

[RouterA] undo vxlan ip-forwarding

# 创建VXLAN 10。

[RouterA] vsi vpna

[RouterA-vsi-vpna] vxlan 10

[RouterA-vsi-vpna-vxlan10] quit

[RouterA-vsi-vpna] quit

2. 配置Router B

# 开启L2VPN功能。

[RouterB] l2vpn enable

# 配置VXLAN隧道工作在二层转发模式。

[RouterB] undo vxlan ip-forwarding

# 创建VXLAN 10。

[RouterB] vsi vpna

[RouterB-vsi-vpna] vxlan 10

[RouterB-vsi-vpna-vxlan10] quit

[RouterB-vsi-vpna] quit

3. 配置Router C

# 开启L2VPN功能。

[RouterC] l2vpn enable

# 配置VXLAN隧道工作在二层转发模式。

[RouterC] undo vxlan ip-forwarding

# 创建VXLAN 10。

[RouterC] vsi vpna

[RouterC-vsi-vpna] vxlan 10

[RouterC-vsi-vpna-vxlan10] quit

[RouterC-vsi-vpna] quit

4.5.4  创建VXLAN隧道

# 在Router A上创建到达Router B和Router C的VXLAN隧道Tunnel1和Tunnel2。

[RouterA] interface tunnel 1 mode vxlan

[RouterA-Tunnel1] source 1.1.1.1

[RouterA-Tunnel1] destination 2.2.2.2

[RouterA-Tunnel1] quit

[RouterA] interface tunnel 2 mode vxlan

[RouterA-Tunnel2] source 1.1.1.1

[RouterA-Tunnel2] destination 3.3.3.3

[RouterA-Tunnel2] quit

# 在Router B上创建到达Router A和Router C的VXLAN隧道Tunnel1和Tunnel2。

[RouterB] interface tunnel 1 mode vxlan

[RouterB-Tunnel1] source 2.2.2.2

[RouterB-Tunnel1] destination 1.1.1.1

[RouterB-Tunnel1] quit

[RouterB] interface tunnel 2 mode vxlan

[RouterB-Tunnel2] source 2.2.2.2

[RouterB-Tunnel2] destination 3.3.3.3

[RouterB-Tunnel2] quit

# 在Router C上创建到达Router A和Router B的VXLAN隧道Tunnel1和Tunnel2。

[RouterC] interface tunnel 1 mode vxlan

[RouterC-Tunnel1] source 3.3.3.3

[RouterC-Tunnel1] destination 1.1.1.1

[RouterC-Tunnel1] quit

[RouterC] interface tunnel 2 mode vxlan

[RouterC-Tunnel2] source 3.3.3.3

[RouterC-Tunnel2] destination 2.2.2.2

[RouterC-Tunnel2] quit

4.5.5  关联VXLAN和VXLAN隧道

# 在Router A上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10关联。

[RouterA] vsi vpna

[RouterA-vsi-vpna] vxlan 10

[RouterA-vsi-vpna-vxlan10] tunnel 1

[RouterA-vsi-vpna-vxlan10] tunnel 2

[RouterA-vsi-vpna-vxlan10] quit

[RouterA-vsi-vpna] quit

# 在Router B上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10关联。

[RouterB] vsi vpna

[RouterB-vsi-vpna] vxlan 10

[RouterB-vsi-vpna-vxlan10] tunnel 1

[RouterB-vsi-vpna-vxlan10] tunnel 2

[RouterB-vsi-vpna-vxlan10] quit

[RouterB-vsi-vpna] quit

# 在Router C上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10关联。

[RouterC] vsi vpna

[RouterC-vsi-vpna] vxlan 10

[RouterC-vsi-vpna-vxlan10] tunnel 1

[RouterC-vsi-vpna-vxlan10] tunnel 2

[RouterC-vsi-vpna-vxlan10] quit

[RouterC-vsi-vpna] quit

4.5.6  配置接口与VSI关联

# 将Router A的接口HundredGigE1/0/1与vpna(VXLAN 10)关联。

[RouterA] interface hundredgige 1/0/1

[RouterA-HundredGigE1/0/1] xconnect vsi vpna

[RouterA-HundredGigE1/0/1] quit

# 将Router B的接口HundredGigE1/0/1与vpna(VXLAN 10)关联。

[RouterB] interface hundredgige 1/0/1

[RouterB-HundredGigE1/0/1] xconnect vsi vpna

[RouterB-HundredGigE1/0/1] quit

# 将Router C的接口HundredGigE1/0/1与vpna(VXLAN 10)关联。

[RouterC] interface hundredgige 1/0/1

[RouterC-HundredGigE1/0/1] xconnect vsi vpna

[RouterC-HundredGigE1/0/1] quit

4.6  验证配置

# 以Router A为例,查看Tunnel接口信息,可以看到VXLAN模式的Tunnel接口处于up状态。

[RouterA] 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

# 以Router A为例,查看VSI信息,可以看到与VXLAN关联的VXLAN隧道、与VSI关联的以太网服务实例均处于up状态。

[RouterA] display l2vpn vsi verbose

VSI Name: vpna

  VSI Index               : 0

  VSI State               : Up

  MTU                     : 1500

  Bandwidth               : Unlimited

  Broadcast Restrain      : 4294967295 kbps

  Multicast Restrain      : 4294967295 kbps

  Unknown Unicast Restrain: 4294967295 kbps

  MAC Learning            : Enabled

  MAC Table Limit         : -

  MAC Learning rate       : -

  Local MAC aging time    : 300 sec

  Remote MAC aging time   : 300 sec

  Drop Unknown            : -

  PW Redundancy Mode      : Slave

  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

    HGE1/0/1                         0        Up          Manual

# 虚拟机VM 1、VM 2、VM 3之间可以互相ping通。

# 以Router A为例,查看VSI的MAC地址表项信息,可以看到已学习到的MAC地址信息。

[RouterA] 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  配置文件

·     Router 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 11.1.1.0 0.0.0.255

#

 l2vpn enable

#

vsi vpna

 vxlan 10

  tunnel 1

  tunnel 2

#

interface LoopBack0

 ip address 1.1.1.1 255.255.255.255

#

interface HundredGigE1/0/1

 xconnect vsi vpna

#

interface HundredGigE1/0/2

 ip address 11.1.1.1 255.255.255.0

#

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

·     Router 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 12.1.1.0 0.0.0.255

#

 l2vpn enable

#

vsi vpna

 vxlan 10

  tunnel 1

  tunnel 2

#

interface LoopBack0

 ip address 2.2.2.2 255.255.255.255

#

interface HundredGigE1/0/1

 xconnect vsi vpna

#

interface HundredGigE1/0/2

 ip address 12.1.1.2 255.255.255.0

#

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

 

·     Router C

#

 undo vxlan ip-forwarding

#

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

#

 l2vpn enable

#

vsi vpna

 vxlan 10

  tunnel 1

  tunnel 2

#

interface LoopBack0

 ip address 3.3.3.3 255.255.255.255

#

interface HundredGigE1/0/1

 xconnect vsi vpna

#

interface HundredGigE1/0/2

 ip address 13.1.1.3 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

·     Router 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

#

interface LoopBack0

 ip address 4.4.4.4 255.255.255.255

#

interface HundredGigE1/0/1

 ip address 11.1.1.4 255.255.255.0

#

interface HundredGigE1/0/2

 ip address 13.1.1.4 255.255.255.0

#

interface HundredGigE1/0/3

 ip address 12.1.1.4 255.255.255.0

#

return

5  集中式VXLAN IP网关配置举例

5.1  组网需求

图2所示,虚拟机VM 1、VM 3属于VXLAN 10,VM 2和VM 4属于VXLAN 20。Router A、Router B为与服务器连接的VTEP设备,Router C为与广域网连接的集中式VXLAN IP网关设备。通过VXLAN实现不同站点间的二层互联,并通过集中式VXLAN IP网关实现不同VXLAN之间、VXLAN与广域网之间的三层互联。

图2 集中式VXLAN IP网关配置组网图

 

5.2  配置思路

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

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

·     在Router A和Router B的下行端口上配置接口关联的VSI,用来识别用户网络中的报文所属的VXLAN。

·     在集中式VXLAN IP网关Router C上为每个VXLAN分别创建一个VSI虚接口,为其配置IP地址,该地址作为各自VXLAN内虚拟机的网关地址;在Router C上配置路由协议将VSI虚接口、HundredGigE1/0/1所在网段路由发布到L3 network,以便L3 network内的节点具有到达虚拟机的路由,本举例以OSPF路由协议为例。

5.3  使用版本

本举例是在R3606版本上进行配置和验证的。

5.4  配置注意事项

缺省情况下,接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。

5.5  配置步骤

5.5.1  配置各接口的IP地址

# 配置Router A的接口IP地址。

<RouterA> system-view

[RouterA] interface hundredgige 1/0/2

[RouterA-HundredGigE1/0/2] ip address 20.1.1.1 24

[RouterA-HundredGigE1/0/2] quit

[RouterA] interface loopback 0

[RouterA-LoopBack0] ip address 1.1.1.1 32

# 请参考以上方法配置其它设备上的接口IP地址,配置步骤这里省略。

5.5.2  在IP核心网络上配置路由协议

# 在Router A上配置OSPF发布接口所在网段的路由。

[RouterA] ospf 1 router-id 1.1.1.1

[RouterA-ospf-1] area 0

[RouterA-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0

[RouterA-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255

[RouterA-ospf-1-area-0.0.0.0] quit

[RouterA-ospf-1] quit

# 在Router B上配置OSPF发布接口所在网段的路由。

[RouterB] ospf 1 router-id 2.2.2.2

[RouterB-ospf-1] area 0

[RouterB-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0

[RouterB-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255

[RouterB-ospf-1-area-0.0.0.0] quit

[RouterB-ospf-1] quit

# 在Router C上配置OSPF发布接口所在网段的路由。

[RouterC] ospf 1 router-id 3.3.3.3

[RouterC-ospf-1] area 0

[RouterC-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0

[RouterC-ospf-1-area-0.0.0.0] network 40.1.1.0 0.0.0.255

[RouterC-ospf-1-area-0.0.0.0] quit

[RouterC-ospf-1] quit

# 在Router D上配置OSPF发布接口所在网段的路由。

[RouterD] ospf 1 router-id 4.4.4.4

[RouterD-ospf-1] area 0

[RouterD-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0

[RouterD-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255

[RouterD-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255

[RouterD-ospf-1-area-0.0.0.0] network 40.1.1.0 0.0.0.255

[RouterD-ospf-1-area-0.0.0.0] quit

[RouterD-ospf-1] quit

5.5.3  创建VXLAN

1. 配置Router A

# 开启L2VPN功能。

[RouterA] l2vpn enable

# 配置VXLAN隧道工作在二层转发模式。

[RouterA] undo vxlan ip-forwarding

# 创建VXLAN 10和VXLAN 20。

[RouterA] vsi vpna

[RouterA-vsi-vpna] vxlan 10

[RouterA-vsi-vpna-vxlan10] quit

[RouterA-vsi-vpna] quit

[RouterA] vsi vpnb

[RouterA-vsi-vpnb] vxlan 20

[RouterA-vsi-vpnb-vxlan10] quit

[RouterA-vsi-vpnb] quit

2. 配置Router B

# 开启L2VPN功能。

[RouterB] l2vpn enable

# 配置VXLAN隧道工作在二层转发模式。

[RouterB] undo vxlan ip-forwarding

# 创建VXLAN 10和VXLAN 20。

[RouterB] vsi vpna

[RouterB-vsi-vpna] vxlan 10

[RouterB-vsi-vpna-vxlan10] quit

[RouterB-vsi-vpna] quit

[RouterB] vsi vpnb

[RouterB-vsi-vpnb] vxlan 20

[RouterB-vsi-vpnb-vxlan10] quit

[RouterB-vsi-vpnb] quit

3. 配置Router C

# 开启L2VPN功能。

[RouterC] l2vpn enable

# 创建VXLAN 10和VXLAN 20。

[RouterC] vsi vpna

[RouterC-vsi-vpna] vxlan 10

[RouterC-vsi-vpna-vxlan10] quit

[RouterC-vsi-vpna] quit

[RouterC] vsi vpnb

[RouterC-vsi-vpnb] vxlan 20

[RouterC-vsi-vpnb-vxlan10] quit

[RouterC-vsi-vpnb] quit

5.5.4  创建VXLAN隧道

# 在Router A上创建到达Router B和Router C的VXLAN隧道Tunnel1和Tunnel2。

[RouterA] interface tunnel 1 mode vxlan

[RouterA-Tunnel1] source 1.1.1.1

[RouterA-Tunnel1] destination 2.2.2.2

[RouterA-Tunnel1] quit

[RouterA] interface tunnel 2 mode vxlan

[RouterA-Tunnel2] source 1.1.1.1

[RouterA-Tunnel2] destination 3.3.3.3

[RouterA-Tunnel2] quit

# 在Router B上创建到达Router A和Router C的VXLAN隧道Tunnel1和Tunnel2。

[RouterB] interface tunnel 1 mode vxlan

[RouterB-Tunnel1] source 2.2.2.2

[RouterB-Tunnel1] destination 1.1.1.1

[RouterB-Tunnel1] quit

[RouterB] interface tunnel 2 mode vxlan

[RouterB-Tunnel2] source 2.2.2.2

[RouterB-Tunnel2] destination 3.3.3.3

[RouterB-Tunnel2] quit

# 在Router C上创建到达Router A和Router B的VXLAN隧道Tunnel1和Tunnel2。

[RouterC] interface tunnel 1 mode vxlan

[RouterC-Tunnel1] source 3.3.3.3

[RouterC-Tunnel1] destination 1.1.1.1

[RouterC-Tunnel1] quit

[RouterC] interface tunnel 2 mode vxlan

[RouterC-Tunnel2] source 3.3.3.3

[RouterC-Tunnel2] destination 2.2.2.2

[RouterC-Tunnel2] quit

5.5.5  关联VXLAN和VXLAN隧道

# 在Router A上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10、VXLAN 20关联。

[RouterA] vsi vpna

[RouterA-vsi-vpna] vxlan 10

[RouterA-vsi-vpna-vxlan10] tunnel 1

[RouterA-vsi-vpna-vxlan10] tunnel 2

[RouterA-vsi-vpna-vxlan10] quit

[RouterA-vsi-vpna] quit

[RouterA] vsi vpnb

[RouterA-vsi-vpnb] vxlan 20

[RouterA-vsi-vpnb-vxlan20] tunnel 1

[RouterA-vsi-vpnb-vxlan20] tunnel 2

[RouterA-vsi-vpnb-vxlan20] quit

[RouterA-vsi-vpnb] quit

# 在Router B上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10、VXLAN 20关联。

[RouterB] vsi vpna

[RouterB-vsi-vpna] vxlan 10

[RouterB-vsi-vpna-vxlan10] tunnel 1

[RouterB-vsi-vpna-vxlan10] tunnel 2

[RouterB-vsi-vpna-vxlan10] quit

[RouterB-vsi-vpna] quit

[RouterB] vsi vpnb

[RouterB-vsi-vpnb] vxlan 20

[RouterB-vsi-vpnb-vxlan20] tunnel 1

[RouterB-vsi-vpnb-vxlan20] tunnel 2

[RouterB-vsi-vpnb-vxlan20] quit

[RouterB-vsi-vpnb] quit

# 在Router C上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10、VXLAN 20关联。

[RouterC] vsi vpna

[RouterC-vsi-vpna] vxlan 10

[RouterC-vsi-vpna-vxlan10] tunnel 1

[RouterC-vsi-vpna-vxlan10] tunnel 2

[RouterC-vsi-vpna-vxlan10] quit

[RouterC-vsi-vpna] quit

[RouterC] vsi vpnb

[RouterC-vsi-vpnb] vxlan 20

[RouterC-vsi-vpnb-vxlan20] tunnel 1

[RouterC-vsi-vpnb-vxlan20] tunnel 2

[RouterC-vsi-vpnb-vxlan20] quit

[RouterC-vsi-vpnb] quit

5.5.6  配置接口与VSI关联

1. 配置Router A

# 将接口HundredGigE1/0/1与vpna(VXLAN 10)关联。

[RouterA] interface hundredgige 1/0/1

[RouterA-HundredGigE1/0/1] xconnect vsi vpna

[RouterA-HundredGigE1/0/1] quit

# 将接口HundredGigE1/0/3与vpnb(VXLAN 20)关联。

[RouterA] interface hundredgige 1/0/3

[RouterA-HundredGigE1/0/3] xconnect vsi vpnb

[RouterA-HundredGigE1/0/3] quit

2. 配置Router B

# 将接口HundredGigE1/0/1与vpna(VXLAN 10)关联。

[RouterB] interface hundredgige 1/0/1

[RouterB-HundredGigE1/0/1] xconnect vsi vpna

[RouterB-HundredGigE1/0/1] quit

# 将接口HundredGigE1/0/3与vpnb(VXLAN 20)关联。

[RouterB] interface hundredgige 1/0/3

[RouterB-HundredGigE1/0/3] xconnect vsi vpnb

[RouterB-HundredGigE1/0/3] quit

5.5.7  配置集中式VXLAN IP网关功能

# 创建VSI虚接口VSI-interface1,并为其配置IP地址,该IP地址作为VXLAN 10内虚拟机的网关地址。

[RouterC] interface vsi-interface 1

[RouterC-Vsi-interface1] ip address 10.1.1.1 255.255.255.0

[RouterC-Vsi-interface1] quit

# 配置VXLAN 10所在的VSI实例与接口VSI-interface1关联。

[RouterC] vsi vpna

[RouterC-vsi-vpna] gateway vsi-interface 1

[RouterC-vsi-vpna] quit

# 创建VSI虚接口VSI-interface2,并为其配置IP地址,该IP地址作为VXLAN 20内虚拟机的网关地址。

[RouterC] interface vsi-interface 2

[RouterC-Vsi-interface2] ip address 10.1.2.1 255.255.255.0

[RouterC-Vsi-interface2] quit

# 配置VXLAN 20所在的VSI实例与接口VSI-interface2关联。

[RouterC] vsi vpnb

[RouterC-vsi-vpnb] gateway vsi-interface 2

[RouterC-vsi-vpnb] quit

# 配置OSPF发布VSI虚接口、HundredGigE1/0/1接口所在网段的路由。

[RouterC] ospf 2 router-id 3.3.3.3

[RouterC-ospf-2] area 0

[RouterC-ospf-2-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[RouterC-ospf-2-area-0.0.0.0] network 10.1.2.0 0.0.0.255

[RouterC-ospf-2-area-0.0.0.0] network 100.1.1.0 0.0.0.255

[RouterC-ospf-2-area-0.0.0.0] quit

[RouterC-ospf-2] quit

5.6  验证配置

# 以Router A为例,在VTEP上查看Tunnel接口信息,可以看到VXLAN模式的Tunnel接口处于up状态。

[RouterA] 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: 64 kbps

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

# 在集中式VXLAN IP网关Router C上,查看Tunnel接口信息,可以看到VXLAN模式的Tunnel接口处于up状态。

[RouterC] 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 3.3.3.3, destination 1.1.1.1

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: 64 kbps

Maximum transmission unit: 1464

Internet protocol processing: Disabled

Last clearing of counters: Never

Tunnel source 3.3.3.3, 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

# 在Router C上,查看VSI虚接口信息,可以看到VSI虚接口处于up状态。

[RouterC] display interface vsi-interface

Vsi-interface1

Current state: UP

Line protocol state: UP

Description: Vsi-interface1 Interface

Bandwidth: 1000000 kbps

Maximum transmission unit: 1500

Internet Address: 10.1.1.1/24 (primary)

IP packet frame type: Ethernet II, hardware address: 0000-fc00-458d

IPv6 packet frame type: Ethernet II, hardware address: 0000-fc00-458d

Physical: Unknown, baudrate: 1000000 kbps

Last clearing of counters: Never

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

 

Vsi-interface2

Current state: UP

Line protocol state: UP

Description: Vsi-interface2 Interface

Bandwidth: 1000000 kbps

Maximum transmission unit: 1500

Internet Address:  10.1.2.1/24 (primary)

IP packet frame type: Ethernet II, hardware address: 0000-fc00-458d

IPv6 packet frame type: Ethernet II, hardware address: 0000-fc00-458d

Physical: Unknown, baudrate: 1000000 kbps

Last clearing of counters: Never

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

# 以Router A为例,在VTEP上查看VSI信息,可以看到VSI内创建的VXLAN、与VXLAN关联的VXLAN隧道、与VSI关联的以太网服务实例等信息。

[RouterA] display l2vpn vsi verbose

VSI Name: vpna

  VSI Index               : 0

  VSI State               : Up

  MTU                     : 1500

  Bandwidth               : Unlimited

  Broadcast Restrain      : 4294967295 kbps

  Multicast Restrain      : 4294967295 kbps

  Unknown Unicast Restrain: 4294967295 kbps

  MAC Learning            : Enabled

  MAC Table Limit         : -

  MAC Learning rate       : -

  Local MAC aging time    : 300 sec

  Remote MAC aging time   : 300 sec

  Drop Unknown            : -

  PW Redundancy Mode      : Slave

  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

    HGE1/0/1                         0          Up          Manual

 

VSI Name: vpnb

  VSI Index               : 1

  VSI State               : Up

  MTU                     : 1500

  Bandwidth               : Unlimited

  Broadcast Restrain      : 4294967295 kbps

  Multicast Restrain      : 4294967295 kbps

  Unknown Unicast Restrain: 4294967295 kbps

  MAC Learning            : Enabled

  MAC Table Limit         : -

  MAC Learning rate       : -

  Local MAC aging time    : 300 sec

  Remote MAC aging time   : 300 sec

  Drop Unknown            : -

  PW Redundancy Mode      : Slave

  Flooding                : Enabled

  Statistics              : Disabled

  VXLAN ID                : 20

  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

    HGE1/0/3                         0          Up          Manual

# 在Router C上查看VSI信息,可以看到VSI内创建的VXLAN、与VXLAN关联的VXLAN隧道、与VSI关联的VSI虚接口等信息。

[RouterC] display l2vpn vsi verbose

VSI Name: vpna

  VSI Index               : 0

  VSI State               : Up

  MTU                     : 1500

  Bandwidth               : Unlimited

  Broadcast Restrain      : 4294967295 kbps

  Multicast Restrain      : 4294967295 kbps

  Unknown Unicast Restrain: 4294967295 kbps

  MAC Learning            : Enabled

  MAC Table Limit         : -

  MAC Learning rate       : -

  Local MAC aging time    : 300 sec

  Remote MAC aging time   : 300 sec

  Drop Unknown            : -

  PW Redundancy Mode      : Slave

  Flooding                : Enabled

  Statistics              : Disabled

  Gateway interface       : VSI-interface 1

  VXLAN ID                : 10

  Tunnels:

    Tunnel Name          Link ID    State    Type        Flooding proxy

    Tunnel1              0x5000002  Up       Manual      Disabled

    Tunnel2              0x5000003  Up       Manual      Disabled

 

VSI Name: vpnb

  VSI Index               : 1

  VSI State               : Up

  MTU                     : 1500

  Bandwidth               : Unlimited

  Broadcast Restrain      : 4294967295 kbps

  Multicast Restrain      : 4294967295 kbps

  Unknown Unicast Restrain: 4294967295 kbps

  MAC Learning            : Enabled

  MAC Table Limit         : -

  MAC Learning rate       : -

  Local MAC aging time    : 300 sec

  Remote MAC aging time   : 300 sec

  Drop Unknown            : -

  PW Redundancy Mode      : Slave

  Flooding                : Enabled

  Statistics              : Disabled

  Gateway interface       : VSI-interface 2

  VXLAN ID                : 20

  Tunnels:

    Tunnel Name          Link ID    State    Type        Flooding proxy

    Tunnel1              0x5000002  Up       Manual      Disabled

    Tunnel2              0x5000003  Up       Manual      Disabled

# 虚拟机VM 1、VM 2、VM3、VM4之间均可以互访,且可以ping通100.1.1.1。

# 查看Router C上VSI的ARP表项信息,可以看到已学习到了虚拟机的ARP信息。

[RouterC] display arp

  Type: S-Static   D-Dynamic   O-Openflow   R-Rule   M-Multiport  I-Invalid

IP address      MAC address    VLAN/VSI name Interface                Aging Type

10.1.1.11       0000-1234-0001 N/A           Tunnel1                  20    D

10.1.1.12       0000-1234-0002 N/A           Tunnel2                  19    D

# 查看Router C上FIB表项信息,可以看到已学习到了虚拟机的转发表项信息。

[RouterC] display fib 10.1.1.11

 

Destination count: 1 FIB entry count: 1

 

Flag:

  U:Useable   G:Gateway   H:Host   B:Blackhole   D:Dynamic   S:Static

  R:Relay     F:FRR

 

Destination/Mask   Nexthop         Flag     OutInterface/Token       Label

10.1.1.11/32       10.1.1.11       UH       Vsi1                     Null

5.7  配置文件

·     Router 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

#

 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 HundredGigE1/0/1

 xconnect vsi vpna

#

interface HundredGigE1/0/2

 ip address 20.1.1.1 255.255.255.0

#

interface HundredGigE1/0/3

 xconnect vsi vpnb

#

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

·     Router 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

#

 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 HundredGigE1/0/1

 xconnect vsi vpna

#

interface HundredGigE1/0/2

 ip address 30.1.1.2 255.255.255.0

#

interface HundredGigE1/0/3

 xconnect vsi vpnb

#

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

·     Router 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

#

 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 HundredGigE1/0/1

 ip address 100.1.1.1 255.255.255.0

#

interface HundredGigE1/0/2

 ip address 40.1.1.3 255.255.255.0

#

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

·     Router 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

#

interface LoopBack0

 ip address 4.4.4.4 255.255.255.255

#

interface HundredGigE1/0/1

 ip address 20.1.1.4 255.255.255.0

#

interface HundredGigE1/0/2

 ip address 30.1.1.4 255.255.255.0

#

interface HundredGigE1/0/3

 ip address 40.1.1.4 255.255.255.0

#

return

6  集中式VXLAN IP网关保护组配置举例

6.1  组网需求

Router A、Router B为与服务器连接的VTEP设备,Router C和Router D为与广域网连接的集中式VXLAN IP网关设备。虚拟机VM 1、VM 3属于VXLAN 10,虚拟机VM 2、VM 4属于VXLAN 20。通过VXLAN IP网关保护组实现Router C和Router D能够同时对虚拟机的跨网络报文进行三层转发,同时实现网关设备的备份。

图3 集中式VXLAN IP网关保护组配置组网图

 

6.2  配置思路

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

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

·     在Router A和Router B的下行端口上配置接口关联的VSI,用来识别用户网络中的报文所属的VXLAN。

·     在集中式VXLAN IP网关Router C和Router D上为每个VXLAN分别创建一个VSI虚接口,并为其配置IP地址,该地址作为各自VXLAN内虚拟机的网关地址;在Router C和Router D上配置路由协议将VSI虚接口、HundredGigE1/0/1所在网段路由发布到L3 network,以便L3 network内的节点具有到达虚拟机的路由,本举例以OSPF路由协议为例。

·     将Router C和Router D加入集中式VXLAN IP网关保护组,实现网关设备的备份。

6.3  使用版本

本举例是在R3606版本上进行配置和验证的。

6.4  配置注意事项

·     保护组中所有网关上的VXLAN配置需要保证完全一致。

·     缺省情况下,接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。

6.5  配置步骤

6.5.1  配置各接口的IP地址

# 配置Router A的接口IP地址。

<RouterA> system-view

[RouterA] interface hundredgige 1/0/2

[RouterA-HundredGigE1/0/2] ip address 20.1.1.1 24

[RouterA-HundredGigE1/0/2] quit

[RouterA] interface loopback 0

[RouterA-LoopBack0] ip address 1.1.1.1 32

# 请参考以上方法配置其它设备上的接口IP地址,配置步骤这里省略。

6.5.2  在IP核心网络上配置路由协议

# 在Router A上配置OSPF发布接口所在网段的路由。

[RouterA] ospf 1 router-id 1.1.1.1

[RouterA-ospf-1] area 0

[RouterA-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0

[RouterA-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255

[RouterA-ospf-1-area-0.0.0.0] quit

[RouterA-ospf-1] quit

# 在Router B上配置OSPF发布接口所在网段的路由。

[RouterB] ospf 1 router-id 2.2.2.2

[RouterB-ospf-1] area 0

[RouterB-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0

[RouterB-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255

[RouterB-ospf-1-area-0.0.0.0] quit

[RouterB-ospf-1] quit

# 在Router C上配置OSPF发布接口所在网段的路由。

[RouterC] ospf 1 router-id 3.3.3.3

[RouterC-ospf-1] area 0

[RouterC-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0

[RouterC-ospf-1-area-0.0.0.0] network 8.8.8.8 0.0.0.0

[RouterC-ospf-1-area-0.0.0.0] network 40.1.1.0 0.0.0.255

[RouterC-ospf-1-area-0.0.0.0] quit

[RouterC-ospf-1] quit

# 在Router D上配置OSPF发布接口所在网段的路由。

[RouterD] ospf 1 router-id 4.4.4.4

[RouterD-ospf-1] area 0

[RouterD-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0

[RouterD-ospf-1-area-0.0.0.0] network 8.8.8.8 0.0.0.0

[RouterD-ospf-1-area-0.0.0.0] network 50.1.1.0 0.0.0.255

[RouterD-ospf-1-area-0.0.0.0] quit

[RouterD-ospf-1] quit

# 在Router E上配置OSPF发布接口所在网段的路由。

[RouterE] ospf 1 router-id 5.5.5.5

[RouterE-ospf-1] area 0

[RouterE-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.0

[RouterE-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255

[RouterE-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255

[RouterE-ospf-1-area-0.0.0.0] network 40.1.1.0 0.0.0.255

[RouterE-ospf-1-area-0.0.0.0] network 50.1.1.0 0.0.0.255

[RouterE-ospf-1-area-0.0.0.0] quit

[RouterE-ospf-1] quit

6.5.3  创建VXLAN

1. 配置Router A

# 开启L2VPN功能。

[RouterA] l2vpn enable

# 配置VXLAN隧道工作在二层转发模式。

[RouterA] undo vxlan ip-forwarding

# 创建VXLAN 10和VXLAN 20。

[RouterA] l2vpn enable

[RouterA] vsi vpna

[RouterA-vsi-vpna] vxlan 10

[RouterA-vsi-vpna-vxlan10] quit

[RouterA-vsi-vpna] quit

[RouterA] vsi vpnb

[RouterA-vsi-vpnb] vxlan 20

[RouterA-vsi-vpnb-vxlan10] quit

[RouterA-vsi-vpnb] quit

2. 配置Router B

# 开启L2VPN功能。

[RouterB] l2vpn enable

# 配置VXLAN隧道工作在二层转发模式。

[RouterB] undo vxlan ip-forwarding

# 创建VXLAN 10和VXLAN 20。

[RouterB] l2vpn enable

[RouterB] vsi vpna

[RouterB-vsi-vpna] vxlan 10

[RouterB-vsi-vpna-vxlan10] quit

[RouterB-vsi-vpna] quit

[RouterB] vsi vpnb

[RouterB-vsi-vpnb] vxlan 20

[RouterB-vsi-vpnb-vxlan10] quit

[RouterB-vsi-vpnb] quit

3. 配置Router C

# 开启L2VPN功能。

[RouterC] l2vpn enable

# 创建VXLAN 10和VXLAN 20。

[RouterC] l2vpn enable

[RouterC] vsi vpna

[RouterC-vsi-vpna] vxlan 10

[RouterC-vsi-vpna-vxlan10] quit

[RouterC-vsi-vpna] quit

[RouterC] vsi vpnb

[RouterC-vsi-vpnb] vxlan 20

[RouterC-vsi-vpnb-vxlan10] quit

[RouterC-vsi-vpnb] quit

4. 配置Router D

# 开启L2VPN功能。

[RouterD] l2vpn enable

# 创建VXLAN 10和VXLAN 20。

[RouterD] l2vpn enable

[RouterD] vsi vpna

[RouterD-vsi-vpna] vxlan 10

[RouterD-vsi-vpna-vxlan10] quit

[RouterD-vsi-vpna] quit

[RouterD] vsi vpnb

[RouterD-vsi-vpnb] vxlan 20

[RouterD-vsi-vpnb-vxlan10] quit

[RouterD-vsi-vpnb] quit

6.5.4  创建VXLAN隧道

1. 配置Router A

# 在Router A和VXLAN IP保护组之间建立VXLAN隧道Tunnel1,隧道的目的端地址为保护组的VTEP IP(8.8.8.8)。

[RouterA] interface tunnel 1 mode vxlan

[RouterA-Tunnel1] source 1.1.1.1

[RouterA-Tunnel1] destination 8.8.8.8

[RouterA-Tunnel1] quit

# 创建到达Router B的VXLAN隧道Tunnel2。

[RouterA] interface tunnel 2 mode vxlan

[RouterA-Tunnel2] source 1.1.1.1

[RouterA-Tunnel2] destination 2.2.2.2

[RouterA-Tunnel2] quit

2. 配置Router B

# 在Router B和VXLAN IP保护组之间建立VXLAN隧道Tunnel1,隧道的目的端地址为保护组的VTEP IP(8.8.8.8)。

[RouterB] interface tunnel 1 mode vxlan

[RouterB-Tunnel1] source 2.2.2.2

[RouterB-Tunnel1] destination 8.8.8.8

[RouterB-Tunnel1] quit

# 创建到达Router A的VXLAN隧道Tunnel2。

[RouterB] interface tunnel 2 mode vxlan

[RouterB-Tunnel2] source 2.2.2.2

[RouterB-Tunnel2] destination 1.1.1.1

[RouterB-Tunnel2] quit

3. 配置Router C

# 创建VXLAN IP保护组到达Router A和Router B的VXLAN隧道Tunnel1和Tunnel2,隧道的源端地址为保护组的VTEP IP(8.8.8.8)。

[RouterC] interface tunnel 1 mode vxlan

[RouterC-Tunnel1] source 8.8.8.8

[RouterC-Tunnel1] destination 1.1.1.1

[RouterC-Tunnel1] quit

[RouterC] interface tunnel 2 mode vxlan

[RouterC-Tunnel2] source 8.8.8.8

[RouterC-Tunnel2] destination 2.2.2.2

[RouterC-Tunnel2] quit

4. 配置Router D

# 创建VXLAN IP保护组到达Router A和Router B的VXLAN隧道Tunnel1和Tunnel2,隧道的源端地址为保护组的VTEP IP(8.8.8.8)。

[RouterD] interface tunnel 1 mode vxlan

[RouterD-Tunnel1] source 8.8.8.8

[RouterD-Tunnel1] destination 1.1.1.1

[RouterD-Tunnel1] quit

[RouterD] interface tunnel 2 mode vxlan

[RouterD-Tunnel2] source 8.8.8.8

[RouterD-Tunnel2] destination 2.2.2.2

[RouterD-Tunnel2] quit

6.5.5  关联VXLAN和VXLAN隧道

# 在Router A上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10、VXLAN 20关联。

[RouterA] vsi vpna

[RouterA-vsi-vpna] vxlan 10

[RouterA-vsi-vpna-vxlan10] tunnel 1

[RouterA-vsi-vpna-vxlan10] tunnel 2

[RouterA-vsi-vpna-vxlan10] quit

[RouterA-vsi-vpna] quit

[RouterA] vsi vpnb

[RouterA-vsi-vpnb] vxlan 20

[RouterA-vsi-vpnb-vxlan20] tunnel 1

[RouterA-vsi-vpnb-vxlan20] tunnel 2

[RouterA-vsi-vpnb-vxlan20] quit

[RouterA-vsi-vpnb] quit

# 在Router B上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10、VXLAN 20关联。

[RouterB] vsi vpna

[RouterB-vsi-vpna] vxlan 10

[RouterB-vsi-vpna-vxlan10] tunnel 1

[RouterB-vsi-vpna-vxlan10] tunnel 2

[RouterB-vsi-vpna-vxlan10] quit

[RouterB-vsi-vpna] quit

[RouterB] vsi vpnb

[RouterB-vsi-vpnb] vxlan 20

[RouterB-vsi-vpnb-vxlan20] tunnel 1

[RouterB-vsi-vpnb-vxlan20] tunnel 2

[RouterB-vsi-vpnb-vxlan20] quit

[RouterB-vsi-vpnb] quit

# 在Router C上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10、VXLAN 20关联。

[RouterC] vsi vpna

[RouterC-vsi-vpna] vxlan 10

[RouterC-vsi-vpna-vxlan10] tunnel 1

[RouterC-vsi-vpna-vxlan10] tunnel 2

[RouterC-vsi-vpna-vxlan10] quit

[RouterC-vsi-vpna] quit

[RouterC] vsi vpnb

[RouterC-vsi-vpnb] vxlan 20

[RouterC-vsi-vpnb-vxlan20] tunnel 1

[RouterC-vsi-vpnb-vxlan20] tunnel 2

[RouterC-vsi-vpnb-vxlan20] quit

[RouterC-vsi-vpnb] quit

# 在Router D上将VXLAN隧道Tunnel1和Tunnel2均与VXLAN 10、VXLAN 20关联。

[RouterD] vsi vpna

[RouterD-vsi-vpna] vxlan 10

[RouterD-vsi-vpna-vxlan10] tunnel 1

[RouterD-vsi-vpna-vxlan10] tunnel 2

[RouterD-vsi-vpna-vxlan10] quit

[RouterD-vsi-vpna] quit

[RouterD] vsi vpnb

[RouterD-vsi-vpnb] vxlan 20

[RouterD-vsi-vpnb-vxlan20] tunnel 1

[RouterD-vsi-vpnb-vxlan20] tunnel 2

[RouterD-vsi-vpnb-vxlan20] quit

[RouterD-vsi-vpnb] quit

6.5.6  配置接口与VSI关联

1. 配置Router A

# 将接口HundredGigE1/0/1与vpna(VXLAN 10)关联。

[RouterA] interface hundredgige 1/0/1

[RouterA-HundredGigE1/0/1] xconnect vsi vpna

[RouterA-HundredGigE1/0/1] quit

# 将接口HundredGigE1/0/3与vpnb(VXLAN 20)关联。

[RouterA] interface hundredgige 1/0/3

[RouterA-HundredGigE1/0/3] xconnect vsi vpnb

[RouterA-HundredGigE1/0/3] quit

2. 配置Router B

# 将接口HundredGigE1/0/1与vpna(VXLAN 10)关联。

[RouterB] interface hundredgige 1/0/1

[RouterB-HundredGigE1/0/1] xconnect vsi vpna

[RouterB-HundredGigE1/0/1] quit

# 将接口HundredGigE1/0/3与vpnb(VXLAN 20)关联。

[RouterB] interface hundredgige 1/0/3

[RouterB-HundredGigE1/0/3] xconnect vsi vpnb

[RouterB-HundredGigE1/0/3] quit

6.5.7  配置集中式VXLAN IP网关功能

1. 配置Router C

# 创建VSI虚接口VSI-interface1,为其配置IP地址,该IP地址作为VXLAN 10内虚拟机的网关地址,指定该接口的MAC地址,并配置该接口定时发送免费ARP报文。

[RouterC] interface vsi-interface 1

[RouterC-Vsi-interface1] ip address 10.1.1.1 255.255.255.0

[RouterC-Vsi-interface1] mac-address 1-1-1

[RouterC-Vsi-interface1] arp send-gratuitous-arp interval 200000

[RouterC-Vsi-interface1] quit

# 配置VXLAN 10所在的VSI实例与接口VSI-interface1关联。

[RouterC] vsi vpna

[RouterC-vsi-vpna] gateway vsi-interface 1

[RouterC-vsi-vpna] quit

# 创建VSI虚接口VSI-interface2,为其配置IP地址,该IP地址作为VXLAN 20内虚拟机的网关地址,指定该接口的MAC地址,并配置该接口定时发送免费ARP报文。

[RouterC] interface vsi-interface 2

[RouterC-Vsi-interface2] ip address 10.1.2.1 255.255.255.0

[RouterC-Vsi-interface2] mac-address 2-2-2

[RouterC-Vsi-interface2] arp send-gratuitous-arp interval 200000

[RouterC-Vsi-interface2] quit

# 配置VXLAN 20所在的VSI实例与接口VSI-interface2关联。

[RouterC] vsi vpnb

[RouterC-vsi-vpnb] gateway vsi-interface 2

[RouterC-vsi-vpnb] quit

# 配置OSPF发布VSI虚接口、HundredGigE1/0/1接口所在网段的路由。

[RouterC] ospf 2 router-id 3.3.3.3

[RouterC-ospf-2] area 0

[RouterC-ospf-2-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[RouterC-ospf-2-area-0.0.0.0] network 10.1.2.0 0.0.0.255

[RouterC-ospf-2-area-0.0.0.0] network 100.1.1.0 0.0.0.255

[RouterC-ospf-2-area-0.0.0.0] quit

[RouterC-ospf-2] quit

2. 配置Router D

# 创建VSI虚接口VSI-interface1,为其配置IP地址,该IP地址作为VXLAN 10内虚拟机的网关地址,指定该接口的MAC地址,并配置该接口定时发送免费ARP报文。

[RouterD] interface vsi-interface 1

[RouterD-Vsi-interface1] ip address 10.1.1.1 255.255.255.0

[RouterD-Vsi-interface1] mac-address 1-1-1

[RouterD-Vsi-interface1] arp send-gratuitous-arp interval 200000

[RouterD-Vsi-interface1] quit

# 配置VXLAN 10所在的VSI实例与接口VSI-interface1关联。

[RouterD] vsi vpna

[RouterD-vsi-vpna] gateway vsi-interface 1

[RouterD-vsi-vpna] quit

# 创建VSI虚接口VSI-interface2,为其配置IP地址,该IP地址作为VXLAN 20内虚拟机的网关地址,指定该接口的MAC地址,并配置该接口定时发送免费ARP报文。

[RouterD] interface vsi-interface 2

[RouterD-Vsi-interface2] ip address 10.1.2.1 255.255.255.0

[RouterD-Vsi-interface2] mac-address 2-2-2

[RouterD-Vsi-interface2] arp send-gratuitous-arp interval 200000

[RouterD-Vsi-interface2] quit

# 配置VXLAN 20所在的VSI实例与接口VSI-interface2关联。

[RouterD] vsi vpnb

[RouterD-vsi-vpnb] gateway vsi-interface 2

[RouterD-vsi-vpnb] quit

# 配置OSPF发布VSI虚接口、HundredGigE1/0/1接口所在网段的路由。

[RouterD] ospf 2 router-id 4.4.4.4

[RouterD-ospf-2] area 0

[RouterD-ospf-2-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[RouterD-ospf-2-area-0.0.0.0] network 10.1.2.0 0.0.0.255

[RouterD-ospf-2-area-0.0.0.0] network 100.1.1.0 0.0.0.255

[RouterD-ospf-2-area-0.0.0.0] quit

[RouterD-ospf-2] quit

6.5.8  配置集中式VXLAN IP网关保护组

1. 配置接入层VTEP设备Router A

# 指定VXLAN IP网关保护组及其成员。

[RouterA] vtep group 8.8.8.8 member remote 3.3.3.3 4.4.4.4

2. 配置接入层VTEP设备Router B

# 指定VXLAN IP网关保护组及其成员。

[RouterB] vtep group 8.8.8.8 member remote 3.3.3.3 4.4.4.4

3. 配置VXLAN IP网关Router C

# 配置VXLAN IP网关保护组,并配置本地成员地址。

[RouterC] vtep group 8.8.8.8 member local 3.3.3.3

# 配置VXLAN IP网关保护组的其它成员地址。

[RouterC] vtep group 8.8.8.8 member remote 4.4.4.4

4. 配置VXLAN IP网关Router D

# 配置VXLAN IP网关保护组,并配置本地成员地址。

[RouterD] vtep group 8.8.8.8 member local 4.4.4.4

# 配置VXLAN IP网关保护组的其它成员地址。

[RouterD] vtep group 8.8.8.8 member remote 3.3.3.3

6.6  验证配置

# 以Router A为例,在VTEP上查看Tunnel接口信息,可以看到VXLAN模式的Tunnel接口处于up状态。其中,Tunnel1和Tunnel2为手工创建的VXLAN隧道,Tunne3和Tunnel4为VTEP与VXLAN IP网关保护组成员设备之间自动建立的VXLAN隧道。

[RouterA] 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 8.8.8.8

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: 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

 

Tunnel3

Current state: UP

Line protocol state: UP

Description: Tunnel3 Interface

Bandwidth: 64 kbps

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

 

Tunnel4

Current state: UP

Line protocol state: UP

Description: Tunnel4 Interface

Bandwidth: 64 kbps

Maximum transmission unit: 1464

Internet protocol processing: Disabled

Last clearing of counters: Never

Tunnel source 1.1.1.1, destination 4.4.4.4

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

# 以Router C为例,在集中式VXLAN IP网关上查看Tunnel接口信息,可以看到VXLAN模式的Tunnel接口处于up状态。

[RouterC] 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 8.8.8.8, destination 1.1.1.1

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: 64 kbps

Maximum transmission unit: 1464

Internet protocol processing: Disabled

Last clearing of counters: Never

Tunnel source 8.8.8.8, 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

# 以Router C为例,在集中式VXLAN IP网关上查看VSI虚接口信息,可以看到VSI虚接口处于up状态。

[RouterC] display interface vsi-interface

Vsi-interface1

Current state: UP

Line protocol state: UP

Description: Vsi-interface1 Interface

Bandwidth: 1000000 kbps

Maximum transmission unit: 1500

Internet Address: 10.1.1.1/24 (primary)

IP packet frame type: Ethernet II, hardware address: 0001-0001-0001

IPv6 packet frame type: Ethernet II, hardware address: 0001-0001-0001

Physical: Unknown, baudrate: 1000000 kbps

Last clearing of counters: Never

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

 

Vsi-interface2

Current state: UP

Line protocol state: UP

Description: Vsi-interface2 Interface

Bandwidth: 1000000 kbps

Maximum transmission unit: 1500

Internet Address:  10.1.2.1/24 (primary)

IP packet frame type: Ethernet II, hardware address: 0002-0002-0002

IPv6 packet frame type: Ethernet II, hardware address: 0002-0002-0002

Physical: Unknown, baudrate: 1000000 kbps

Last clearing of counters: Never

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

# 以Router A为例,在VTEP上查看VSI信息,可以看到VSI内创建的VXLAN、与VXLAN关联的VXLAN隧道、与VSI关联的以太网服务实例等信息。

[RouterA] display l2vpn vsi verbose

VSI Name: vpna

  VSI Index               : 0

  VSI State               : Up

  MTU                     : 1500

  Bandwidth               : Unlimited

  Broadcast Restrain      : 4294967295 kbps

  Multicast Restrain      : 4294967295 kbps

  Unknown Unicast Restrain: 4294967295 kbps

  MAC Learning            : Enabled

  MAC Table Limit         : -

  MAC Learning rate       : -

  Local MAC aging time    : 300 sec

  Remote MAC aging time   : 300 sec

  Drop Unknown            : -

  PW Redundancy Mode      : Slave

  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

    Tunnel3              0x5000003  Up     Auto        Disabled

    Tunnel4              0x5000004  Up     Auto        Disabled

  ACs:

    AC                               Link ID    State       Type

    HGE1/0/1                         0          Up          Manual

 

VSI Name: vpnb

  VSI Index               : 1

  VSI State               : Up

  MTU                     : 1500

  Bandwidth               : Unlimited

  Broadcast Restrain      : 4294967295 kbps

  Multicast Restrain      : 4294967295 kbps

  Unknown Unicast Restrain: 4294967295 kbps

  MAC Learning            : Enabled

  MAC Table Limit         : -

  MAC Learning rate       : -

  Local MAC aging time    : 300 sec

  Remote MAC aging time   : 300 sec

  Drop Unknown            : -

  PW Redundancy Mode      : Slave

  Flooding                : Enabled

  Statistics              : Disabled

  VXLAN ID                : 20

  Tunnels:

    Tunnel Name          Link ID    State  Type        Flood proxy

    Tunnel1              0x5000001  Up     Manual      Disabled

    Tunnel2              0x5000002  Up     Manual      Disabled

    Tunnel3              0x5000003  Up     Auto        Disabled

    Tunnel4              0x5000004  Up     Auto        Disabled

  ACs:

    AC                               Link ID    State       Type

    HGE1/0/3                         0          Up          Manual

# 以Router C为例,在集中式VXLAN IP网关上查看VSI信息,可以看到VSI内创建的VXLAN、与VXLAN关联的VXLAN隧道、与VSI关联的VSI虚接口等信息。

[RouterC] display l2vpn vsi verbose

VSI Name: vpna

  VSI Index               : 0

  VSI State               : Up

  MTU                     : 1500

  Bandwidth               : Unlimited

  Broadcast Restrain      : 4294967295 kbps

  Multicast Restrain      : 4294967295 kbps

  Unknown Unicast Restrain: 4294967295 kbps

  MAC Learning            : Enabled

  MAC Table Limit         : -

  MAC Learning rate       : -

  Local MAC aging time    : 300 sec

  Remote MAC aging time   : 300 sec

  Drop Unknown            : -

  PW Redundancy Mode      : Slave

  Flooding                : Enabled

  Statistics              : Disabled

  Gateway interface       : VSI-interface 1

  VXLAN ID                : 10

  Tunnels:

    Tunnel Name          Link ID    State    Type        Flooding proxy

    Tunnel1              0x5000002  Up       Manual      Disabled

    Tunnel2              0x5000003  Up       Manual      Disabled

 

VSI Name: vpnb

  VSI Index               : 1

  VSI State               : Up

  MTU                     : 1500

  Bandwidth               : Unlimited

  Broadcast Restrain      : 4294967295 kbps

  Multicast Restrain      : 4294967295 kbps

  Unknown Unicast Restrain: 4294967295 kbps

  MAC Learning            : Enabled

  MAC Table Limit         : -

  MAC Learning rate       : -

  Local MAC aging time    : 300 sec

  Remote MAC aging time   : 300 sec

  Drop Unknown            : -

  PW Redundancy Mode      : Slave

  Flooding                : Enabled

  Statistics              : Disabled

  Gateway interface       : VSI-interface 2

  VXLAN ID                : 20

  Tunnels:

    Tunnel Name          Link ID    State    Type        Flooding proxy

    Tunnel1              0x5000002  Up       Manual      Disabled

    Tunnel2              0x5000003  Up       Manual      Disabled

# 虚拟机VM 1、VM 2、VM3、VM4之间均可以互访,且可以ping通100.1.1.0/24网段内的地址。

# 在Router C上查看VSI的ARP表项信息,可以看到已学习到了虚拟机的ARP信息。

[RouterC] display arp

  Type: S-Static   D-Dynamic   O-Openflow   R-Rule   M-Multiport  I-Invalid

IP address      MAC address    VLAN/VSI name Interface                Aging Type

10.1.1.11       0000-1234-0001 N/A           Tunnel1                  20    D

10.1.1.12       0000-1234-0002 N/A           Tunnel2                  19    D

# 在Router C上查看FIB表项信息,可以看到已学习到了虚拟机的转发表项信息。

[RouterC] display fib 10.1.1.11

 

Destination count: 1 FIB entry count: 1

 

Flag:

  U:Useable   G:Gateway   H:Host   B:Blackhole   D:Dynamic   S:Static

  R:Relay     F:FRR

 

Destination/Mask   Nexthop         Flag     OutInterface/Token       Label

10.1.1.11/32       10.1.1.11       UH       Vsi1                     Null

# 在Router D上查看VSI的ARP表项信息和FIB表项信息,可以看到该信息与Router C上的信息一致。

[RouterD] display arp

  Type: S-Static   D-Dynamic   O-Openflow   R-Rule   M-Multiport  I-Invalid

IP address      MAC address    VLAN/VSI name Interface                Aging Type

10.1.1.11       0000-1234-0001 N/A           Tunnel1                  20    D

10.1.1.12       0000-1234-0002 N/A           Tunnel2                  19    D

[RouterD] display fib 10.1.1.11

 

Destination count: 1 FIB entry count: 1

 

Flag:

  U:Useable   G:Gateway   H:Host   B:Blackhole   D:Dynamic   S:Static

  R:Relay     F:FRR

 

Destination/Mask   Nexthop         Flag     OutInterface/Token       Label

10.1.1.11/32       10.1.1.11       UH       Vsi1                     Null

6.7  配置文件

·     Router 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

#

 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 HundredGigE1/0/1

 xconnect vsi vpna

#

interface HundredGigE1/0/2

 ip address 20.1.1.1 255.255.255.0

#

interface HundredGigE1/0/3

 xconnect vsi vpnb

#

interface Tunnel1 mode vxlan

 source 1.1.1.1

 destination 8.8.8.8

#

interface Tunnel2 mode vxlan

 source 1.1.1.1

 destination 2.2.2.2

#

 vtep group 8.8.8.8 member remote 3.3.3.3 4.4.4.4

#

·     Router 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

#

 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 HundredGigE1/0/1

 xconnect vsi vpna

#

interface HundredGigE1/0/2

 ip address 30.1.1.2 255.255.255.0

#

interface HundredGigE1/0/3

 xconnect vsi vpnb

#

interface Tunnel1 mode vxlan

 source 2.2.2.2

 destination 8.8.8.8

#

interface Tunnel2 mode vxlan

 source 2.2.2.2

 destination 1.1.1.1

#

 vtep group 8.8.8.8 member remote 3.3.3.3 4.4.4.4

#

·     Router C

#

ospf 1 router-id 3.3.3.3

 area 0.0.0.0

  network 3.3.3.3 0.0.0.0

  network 8.8.8.8 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

#

 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 LoopBack1

 ip address 8.8.8.8 255.255.255.255

#

interface HundredGigE1/0/1

 ip address 100.1.1.3 255.255.255.0

#

interface HundredGigE1/0/2

 ip address 40.1.1.3 255.255.255.0

#

interface Vsi-interface1

 ip address 10.1.1.1 255.255.255.0

 mac-address 0001-0001-0001

 arp send-gratuitous-arp interval 200000

#

interface Vsi-interface2

 ip address 10.1.2.1 255.255.255.0

 mac-address 0002-0002-0002

 arp send-gratuitous-arp interval 200000

#

interface Tunnel1 mode vxlan

 source 8.8.8.8

 destination 1.1.1.1

#

interface Tunnel2 mode vxlan

 source 8.8.8.8

 destination 2.2.2.2

#

 vtep group 8.8.8.8 member local 3.3.3.3

#

 vtep group 8.8.8.8 member remote 4.4.4.4

#

return

·     Router D

#

ospf 1 router-id 4.4.4.4

 area 0.0.0.0

  network 4.4.4.4 0.0.0.0

  network 8.8.8.8 0.0.0.0

  network 50.1.1.0 0.0.0.255

#

ospf 2 router-id 4.4.4.4

 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

#

 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 4.4.4.4 255.255.255.255

#

interface LoopBack1

 ip address 8.8.8.8 255.255.255.255

#

interface HundredGigE1/0/1

 ip address 100.1.1.4 255.255.255.0

#

interface HundredGigE1/0/2

 ip address 50.1.1.4 255.255.255.0

#

interface Vsi-interface1

 ip address 10.1.1.1 255.255.255.0

 mac-address 0001-0001-0001

 arp send-gratuitous-arp interval 200000

#

interface Vsi-interface2

 ip address 10.1.2.1 255.255.255.0

 mac-address 0002-0002-0002

 arp send-gratuitous-arp interval 200000

#

interface Tunnel1 mode vxlan

 source 8.8.8.8

 destination 1.1.1.1

#

interface Tunnel2 mode vxlan

 source 8.8.8.8

 destination 2.2.2.2

#

 vtep group 8.8.8.8 member local 4.4.4.4

#

 vtep group 8.8.8.8 member remote 3.3.3.3

#

return

·     Router E

#

ospf 1 router-id 5.5.5.5

 area 0.0.0.0

  network 5.5.5.5 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

  network 50.1.1.0 0.0.0.255

#

interface LoopBack0

 ip address 5.5.5.5 255.255.255.255

#

interface HundredGigE1/0/1

 ip address 20.1.1.5 255.255.255.0

#

interface HundredGigE1/0/2

 ip address 30.1.1.5 255.255.255.0

#

interface HundredGigE1/0/3

 ip address 40.1.1.5 255.255.255.0

#

interface HundredGigE1/0/4

 ip address 50.1.1.5 255.255.255.0

#

return

7  相关资料

·     H3C S12500R系列交换路由器 VXLAN配置指导-R3606

·     H3C S12500R系列交换路由器 VXLAN命令参考-R3606

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们