一、组网需求

  两地三中心通过IP核心网进行三层网络互联

 

二、组网拓扑

 

三、配置要点

      在交换机上配置好VLAN。略

  在交换机配置IPv4单播路由协议(如OSPF),保证单播路由可达。略

  配置组播IGMP功能,保证交换机做能够接收特定组播组的报文。(可选)略

  创建L2GRE实例

  配置L2GRE实例本端地址,对端地址

  配置L2GRE实例允许转发的VLAN

  配置保活功能(可选)

  配置组播播GRE泛洪功能( 可选:在需要使用组播功能时开启

 

      注意:保活功能是对实例的对端地址进行检测(也就是邻居检测),配置之后,通过syslog将邻居状态的提示打印到控制台。例如:

   %L2GRE-6-KEEPALIVE: L2GRE instance VPNID[4000] Source[3.1.1.1] to Destination[4.1.1.1] keepalive is down.

   %L2GRE-6-KEEPALIVE: L2GRE instance VPNID[4000] Source[3.1.1.1] to Destination[4.1.1.1] keepalive is up.

       建议开启保活功能。

 

 

四、配置步骤

  配置数据中心交换机A

  A#conf t

  A(config)# l2 gre vpn-l2gre id 100 type lan   ---->配置L2GRE实例

  A(config-l2gre-lan-100)# source interface gi1/1   ---->配置实例本端地址/接口

  A(config-l2gre-lan-100)# destination 3.3.3.3   ---->配置实例对端地址

  A(config-l2gre-lan-100)# destination 2.2.2.2   ---->配置实例对端地址

  A(config-l2gre-lan-100)# extend-vlan add 100   ---->配置L2GRE实例允许转发的VLAN

  A(config-l2gre-lan-100)# keepalive 60 3   ---->配置保活功能(可选)

  A(config-l2gre-lan-100)# multicast 224.1.1.1   ---->配置组播播GRE泛洪功能(可选)

  A(config-l2gre-lan-100)# end

  A(config)# 

 

  配置数据中心交换机B   ---->同数据中心交换机A

  B#conf t

  B(config)# l2 gre vpn-l2gre id 100 type lan

  B(config-l2gre-lan-100)# source interface gi1/1

  B(config-l2gre-lan-100)# destination 3.3.3.3

  B(config-l2gre-lan-100)# destination 1.1.1.1

  B(config-l2gre-lan-100)# extend-vlan add 100

  B(config-l2gre-lan-100)# keepalive 60 3

  B(config-l2gre-lan-100)# multicast 224.1.1.1

  B(config-l2gre-lan-100)# end

  B(config)# 

 

  配置数据中心交换机C   ---->同数据中心交换机A

  C#conf t

  C(config)# l2 gre vpn-l2gre id 100 type lan

  C(config-l2gre-lan-100)# source interface gi1/1

  C(config-l2gre-lan-100)# destination 2.2.2.2

  C(config-l2gre-lan-100)# destination 1.1.1.1

  C(config-l2gre-lan-100)# extend-vlan add 100

  C(config-l2gre-lan-100)# keepalive 60 3

  C(config-l2gre-lan-100)# multicast 224.1.1.1

  C(config-l2gre-lan-100)# end

  C(config)# 

五、功能验证

  1、查看数据中心交换机A L2 GRE实例明细

  A#  show l2 gre vpn-l2gre

              name: vpn-l2gre    id: 100 type: l2gre-lan

              source: 1.1.1.1

              destnation: 2.2.2.2

              destnation: 3.3.3.3

              extend-vlan: 100

              tunnel ttl: 64

              Keepalive set (60 sec), retries 3

  multicast: enable. Ip 224.1.1.1

  2、查看数据中心交换机B L2 GRE实例明细

  B#  show l2 gre vpn-l2gre

              name: vpn-l2gre    id: 100 type: l2gre-lan

              source: 2.2.2.2

              destnation: 1.1.1.1

              destnation: 3.3.3.3

              extend-vlan: 100

              tunnel ttl: 64

              Keepalive set (60 sec), retries 3

      multicast: enable. Ip 224.1.1.1

  3、查看数据中心交换机C L2 GRE实例明细

  C#  show l2 gre vpn-l2gre

              name: vpn-l2gre    id: 100 type: l2gre-lan

              source: 3.3.3.3

              destnation: 1.1.1.1

              destnation: 2.2.2.2

              extend-vlan: 100

              tunnel ttl: 64

              Keepalive set (60 sec), retries 3

      multicast: enable. Ip 224.1.1.1

  4、HOSTA与HOSTB间正常互访

 

  5、数据中心交换机可正常学习,二层网络中的MAC地址。

  A# show l2 gre vpn-l2gre mac

  MAC Address      Destination Address     Type  Interface

  14fe.0811.7300   3.3.3.3                      D     --            ---->同数据中心交换机C下联服务器MAC                             

  14fe.b5e1.0890   2.2.2.2                      D     --            ---->同数据中心交换机B下联服务器MAC                                                       

  14fe.b5e1.0970   --                                     D     Gi1/2