VXLAN分布式BGP E***配置示例详细

  1. 分布式VXLAN网关配置思路

1).配置underlay网络实现互联互通

2).启用vxlan功能

3).配置业务接入点

4).启用E***功能

5).配置BGP对等体

6).配置E***实例

7).配置头端复制列表

8).配置***实例

9).配置VBDIF并绑定***实例,配置发布路由类型

10).配置BGP对等体路由类型

此次环境如下:

ensp 版本1.3.00.100

ce12800 版本V200R005C10SPC607B607

virtualbox 版本5.1.26

配置拓扑图如下:

企业微信截图_16091263464716.png

2.配置CE1-CE3使用OSPF实现三层互联互通:

CE1:

[ce1]ospf 1 router-id 1.1.1.1 \\配置OSPF进程1

[ce1-ospf-1]area 0

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

[ce1-ospf-1]quit

[ce1]interface  g1/0/0

[ce1-ge1/0/0]undo shutdown

[ce1-ge1/0/0]undo portswitch

[ce1-ge1/0/0]ip address 192.168.12.1 255.255.255.0

[ce1-ge1/0/0]ospf enable 1 area 0 \\端口加入OSPF进程

[ce1-ge1/0/0]interface loopback 0 

[ce1-loopback1]ip address 1.1.1.1 255.255.255.255

[ce1-loopback1]ospf enable 1 area 0

[ce1-loopback1]interface g1/0/1

[ce1-ge1/0/1]undo shutdown

[ce1-ge1/0/1]undo portswitch

[ce1-ge1/0/1]ip address 192.168.13.1 255.255.255.255

[ce1-ge1/0/1]ospf enable 1 area 0

[ce1-ge1/0/1]quit

[ce1]commit


CE2:

[ce2]ospf 1 router-id 2.2.2.2

[ce2-ospf-1]area 0

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

[ce2-ospf-1]quit

[ce2]interface  g1/0/0

[ce2-ge1/0/0]undo shutdown

[ce2-ge1/0/0]undo portswitch

[ce2-ge1/0/0]ip address 192.168.12.2 255.255.255.0

[ce2-ge1/0/0]ospf enable 1 area 0

[ce2-ge1/0/0]interface loopback 0 

[ce2-loopback1]ip address 2.2.2.2 255.255.255.255

[ce2-loopback1]ospf enable 1 area 0

[ce2-loopback1]quit

[ce2]commit


CE3:

[ce3]ospf 1 router-id 3.3.3.3

[ce3-ospf-1]area 0

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

[ce3-ospf-1]quit

[ce3]interface  g1/0/0

[ce3-ge1/0/0]undo shutdown

[ce3-ge1/0/0]undo portswitch

[ce3-ge1/0/0]ip address 192.168.13.3 255.255.255.0

[ce3-ge1/0/0]ospf enable 1 area 0

[ce3-ge1/0/0]interface loopback 0

[ce3-loopback1]ip address 3.3.3.3 255.255.255.255

[ce3-loopback1]ospf enable 1 area 0

[ce3-loopback1]quit

[ce3]commit


配置注意点:

1)注意交换机端口默认状态为shutdown,需要手动undo shutdown

ce3上ospf状态查看

CE3上OSPF状态查看.PNG

3.配置vxlan隧道模式,并使能vxlan的acl扩展功能

ip tunnel mode vxlan \\配置隧道模式为vxlan

assign forward nvo3 acl extend enable \\使能vxlan的ACL扩展功能,以防ACL叠加失败

配置注意点:

此处模拟器不支持配置命令,实际环境还是要配置的,配置命令后交换机需要重启。

4.配置LSW1 LSW2接入交换机vlan、trunk

lsw1:

[lsw1]vlan 10

[lsw1-vlan10]quit

[lsw1]vlan 20

[lsw1-vlan20]quit

[lsw1]interface  e0/0/2

[lsw1-ethernet0/0/2]port link-type access

[lsw1-ethernet0/0/2]port default vlan 10

[lsw1-ethernet0/0/2]interface  e0/0/3

[lsw1-ethernet0/0/3]port link-type access

[lsw1-ethernet0/0/3]port default vlan 20

[lsw1-ethernet0/0/3]interface  e0/0/1

[lsw1-ethernet0/0/1]port link-type trunk

[lsw1-ethernet0/0/1]port trunk allow-pass vlan all


lsw2:

[lsw2]vlan 20

[lsw2-vlan20]quit

[lsw2]interface  e0/0/2

[lsw2-ethernet0/0/2]port link-type access

[lsw2-ethernet0/0/2]port default vlan 20

[lsw2-ethernet0/0/2]interface  e0/0/1

[lsw2-ethernet0/0/1]port link-type trunk

[lsw2-ethernet0/0/1]port trunk allow-pass vlan all


5.配置vxlan业务接入点,配置PC1 PC2 PC3所连交换机端口vxlan功能

CE2:

[ce2]vlan 10

[ce2-vlan10]quit

[ce2]vlan 20

[ce2-vlan20]quit

[ce2]commit

[ce2]bridge-domain 10

[ce2-bd10]quit

[ce2]bridge-domain 20

[ce2-bd20]quit

[ce2]interface g1/0/1

[ce2-ge1/0/1]undo shutdown \\主端口默认shutdown

[ce2-ge1/0/1]interface g1/0/1.1 mode l2

[ce2-ge1/0/1.1]encapsulation dot1q vid 10 \\配置封装vlan10

[ce2-ge1/0/1.1]bridge-domain 10 \\关联BD域

[ce2-ge1/0/1.1]interface g1/0/1.2 mode l2

[ce2-ge1/0/1.2]encapsulation dot1q vid 20 \\配置封装vlan20

[ce2-ge1/0/1.2]bridge-domain 20 \\关联BD域

[ce2-ge1/0/1.2]quit

[ce2]commit


CE3:

[ce3]vlan 20

[ce3-vlan20]quit

[ce3]bridge-domain 20

[ce3-bd20]quit

[ce3]interface g1/0/1

[ce3-ge1/0/1]undo shutdown

[ce3-ge1/0/1]interface g1/0/1.1 mode l2

[ce3-ge1/0/1.1]encapsulation dot1q vid 20

[ce3-ge1/0/1.1]bridge-domain 20

[ce3-ge1/0/1.1]quit

[ce3]commit


6.使能E***作为vxlan控制平面功能

ce1:

[ce1]e***-overlay enable

[ce1]commit


ce2:

[ce2]e***-overlay enable

[ce2]commit


ce3:

[ce3]e***-overlay enable

[ce3]commit


7.配置BGP E***对等体关系

ce2:

[ce2]bgp 1

[ce2-bgp]router-id 2.2.2.2

[ce2-bgp]peer 3.3.3.3 as-number 1

[ce2-bgp]peeer 3.3.3.3 connect-interface loopback0

[ce2-bgp]l2***-family e***

[ce2-bgp-af-e***]peer 3.3.3.3 enable

[ce2-bgp-af-e***]quit

[ce2-bgp]quit

[ce2]commit


ce3:

[ce3]bgp 1

[ce3-bgp]router-id 3.3.3.3

[ce3-bgp]peer 2.2.2.2 as-number 1

[ce3-bgp]peeer 2.2.2.2 connect-interface 3.3.3.3

[ce3-bgp]l2***-family e***

[ce3-bgp-af-e***]peer 2.2.2.2 enable

[ce3-bgp-af-e***]quit

[ce3-bgp]quit

[ce3]commit


BGP E***对等体关系状态查看。

CE3上查看BGP E***对等体关系.PNG

8.配置E***实例

ce2

[ce2]bridge-domain 10

[ce2-bd10]vxlan vni 1

[ce2-bd10]e***

[ce2-bd10-e***]route-distinguisher 1:1

[ce2-bd10-e***]***-target 1:1 both

[ce2-bd10-e***]***-target 1:10 export-extcommunity

[ce2-bd10-e***]quit

[ce2-bd10]quit

[ce2]bridge-domain 20

[ce2-bd20]vxlan vni 2

[ce2-bd20]e***

[ce2-bd20-e***]route-distinguisher 1:3

[ce2-bd20-e***]***-target 2:2 both

[ce2-bd20-e***]***-target 1:10 export-extcommunity

[ce2-bd20-e***]quit

[ce2-bd20]quit

[ce2]commit


ce3

[ce3]bridge-domain 20

[ce3-bd20]vxlan vni 2

[ce3-bd20]e***

[ce3-bd20-e***]route-distinguisher 1:5

[ce3-bd20-e***]***-target 2:2

[ce3-bd20-e***]***-target 1:10 export-extcommunity

[ce3-bd20-e***]quit

[ce3-bd20]quit

[ce3]commit


9.配置头端复制列表,


ce2:

[ce2]interface nve1

[ce2-nve1]source 2.2.2.2

[ce2-nve1]vni 1 head-end peer-list protocol bgp

[ce2-nve1]vni 2 head-end peer-list protocol bgp

[ce2-nve1]quit

[ce2]commit


ce3:

[ce3]interface nve1

[ce3-nve1]source 3.3.3.3

[ce3-nve1]vni 2 head-end peer-list protocol bgp

[ce3-nve1]quit

[ce3]commit


10.配置***实例

CE2:

[ce2]ip ***-instance bd10

[ce2-***-instance-bd10]vxlan vni 10

[ce2-***-instance-bd10]ipv4-family

[ce2-***-instance-bd10-af-ipv4]route-distinguisher 1:2

[ce2-***-instance-bd10-af-ipv4]***-target 1:10 e***

[ce2-***-instance-bd10-af-ipv4]quit

[ce2-***-instance-bd10]quit

[ce2]commit


CE3:

[ce3]ip ***-instance bd10

[ce3-***-instance-bd10]vxlan vni 10

[ce3-***-instance-bd10]ipv4-family

[ce3-***-instance-bd10-af-ipv4]route-distinguisher 1:6

[ce3-***-instance-bd10-af-ipv4]***-target 1:10 e***

[ce3-***-instance-bd10-af-ipv4]quit

[ce3-***-instance-bd10]quit

[ce3]commit


11.配置VBDIF并绑定***实例,配置发布路由类型

ce2

[ce2]interface vbdif 10

[ce2-vbdif10]ip binding ***-instance bd10

[ce2-vbdif10]ip address 10.1.1.254 255.255.255.0

[ce2-vbdif10]vxlan anycast-gateway enable

[ce2-vbdif10]arp collect host enable

[ce2-vbdif10]quit

[ce2]interface vbdif 20

[ce2-vbdif20]ip binding ***-instance bd10

[ce2-vbdif20]ip address 10.2.2.254 255.255.255.0

[ce2-vbdif20]mac-address 0000-1111-0001    \\实机使用0000-5e00-000X来做虚拟MAC

[ce2-vbdif20]vxlan anycast-gateway enable

[ce2-vbdif20]arp collect host enable

[ce2-vbdif20]quit

[ce2]commit


ce3

[ce3]interface vbdif 20

[ce3-vbdif20]ip binding ***-instance bd10

[ce3-vbdif20]ip address 10.2.2.254 255.255.255.0

[ce3-vbdif20]mac-address 0000-1111-0001

[ce3-vbdif20]vxlan anycast-gateway enable

[ce3-vbdif20]arp collect host enable

[ce3-vbdif20]quit

[ce3]commit


12.配置BGP对等体路由类型

ce2

[ce2]bgp 1

[ce2-bgp]l2***-family e***

[ce2-bgp-af-e***]peer 3.3.3.3 advertise irb

[ce2-bgp-af-e***]quit

[ce2-bgp]quit

[ce2]commit


ce3

[ce3]bgp 1

[ce3-bgp]l2***-family e***

[ce3-bgp-af-e***]peer 2.2.2.2 advertise irb

[ce3-bgp-af-e***]quit

[ce3-bgp]quit

[ce3]commit

13.状态检查

1)ce3上隧道状态查看

CE3上查看隧道状态.PNG

2)PC3连通性测试

PC3连通性测试.PNG

3)CE2上查看主机路由信息

CE2查看主机路由信息.PNG

3)CE3上查看主机路由信息

CE3上查看主机路由信息.PNG

这是一个基本的VXLAN分布式网关示例。

如有资料需要和实验讨论还请查看我的签名信息,进行联系。

猜你喜欢

转载自blog.51cto.com/7104405/2575992