VXLAN

display vxlan vni
display vxlan tunnel
display bgp e all routing-table

配置同网段用户通过VXLAN隧道互通示例

VXLAN_第1张图片

#
sysname Device1
#
bridge-domain 10 # 配置BD与VNI映射
 vxlan vni 5010
#
interface GigabitEthernet1/0/1
 undo shutdown
 ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet1/0/2
 undo shutdown
#
interface GigabitEthernet1/0/2.1 mode l2 # 在二层子接口配置vlan终结并绑定BD
 encapsulation dot1q vid 10
 rewrite pop single
 bridge-domain 10
#
interface LoopBack1
 ip address 2.2.2.2 255.255.255.255
#
interface Nve1 # 配置VTEP
 source 2.2.2.2
 vni 5010 head-end peer-list 4.4.4.4
#
ospf 1
 area 0.0.0.0
  network 2.2.2.2 0.0.0.0
  network 192.168.1.0 0.0.0.255
#
return
#
sysname Device2
#
interface GigabitEthernet1/0/1
 undo shutdown
 ip address 192.168.1.2 255.255.255.0
#
interface GigabitEthernet1/0/2
 undo shutdown
 ip address 192.168.2.1 255.255.255.0
#
interface LoopBack1
 ip address 3.3.3.3 255.255.255.255
#
ospf 1
 area 0.0.0.0
  network 3.3.3.3 0.0.0.0
  network 192.168.1.0 0.0.0.255
  network 192.168.2.0 0.0.0.255
#
return
#
sysname Device3
#
bridge-domain 10
 vxlan vni 5010
#
interface GigabitEthernet1/0/1
 undo shutdown
 ip address 192.168.2.2 255.255.255.0
#
interface GigabitEthernet1/0/2
 undo shutdown
#
interface GigabitEthernet1/0/2.1 mode l2 #vlan与bd在二层子接口绑定
 encapsulation dot1q vid 20
 rewrite pop single
 bridge-domain 10
#
interface LoopBack1
 ip address 4.4.4.4 255.255.255.255
#
interface Nve1
 source 4.4.4.4
 vni 5010 head-end peer-list 2.2.2.2
#
ospf 1
 area 0.0.0.0
  network 4.4.4.4 0.0.0.0
  network 192.168.2.0 0.0.0.255
#
return

配置不同网段用户通过VXLAN三层网关通信示例

VXLAN_第2张图片

#
sysname Device1
#
bridge-domain 10
 vxlan vni 5010
#
interface GigabitEthernet1/0/1
 undo shutdown
 ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet1/0/2
 undo shutdown
#
interface GigabitEthernet1/0/2.1 mode l2
 encapsulation dot1q vid 10
 rewrite pop single
 bridge-domain 10
#
interface LoopBack1
 ip address 2.2.2.2 255.255.255.255
#
interface Nve1
 source 2.2.2.2
 vni 5010 head-end peer-list 3.3.3.3
#
ospf 1
 area 0.0.0.0
  network 2.2.2.2 0.0.0.0
  network 10.1.1.0 0.0.0.255
  network 192.168.1.0 0.0.0.255
#
return
#
sysname Device2
#
bridge-domain 10
 vxlan vni 5010
#
bridge-domain 20 #配置BD对应的VNI
 vxlan vni 5020
#
interface Vbdif10 #配置vbdif
 ip address 192.168.10.10 255.255.255.0
#
interface Vbdif20
 ip address 192.168.20.10 255.255.255.0
#
interface GigabitEthernet1/0/1
 undo shutdown
 ip address 192.168.1.2 255.255.255.0
#
interface GigabitEthernet1/0/2
 undo shutdown
 ip address 192.168.2.1 255.255.255.0
#
interface LoopBack1
 ip address 3.3.3.3 255.255.255.255
#
interface Nve1
 source 3.3.3.3
 vni 5010 head-end peer-list 2.2.2.2
 vni 5020 head-end peer-list 4.4.4.4
#
ospf 1
 area 0.0.0.0
  network 3.3.3.3 0.0.0.0
  network 192.168.1.0 0.0.0.255
  network 192.168.2.0 0.0.0.255
#
return
#
sysname Device3
#
bridge-domain 20
 vxlan vni 5020
#
interface GigabitEthernet1/0/1
 undo shutdown
 ip address 192.168.2.2 255.255.255.0
#
interface GigabitEthernet1/0/2
 undo shutdown
#
interface GigabitEthernet1/0/2.1 mode l2 # 在二层子接口配置vlan终结并绑定BD
 encapsulation dot1q vid 20
 rewrite pop single
 bridge-domain 20
#
interface LoopBack1
 ip address 4.4.4.4 255.255.255.255
#
interface Nve1
 source 4.4.4.4
 vni 5020 head-end peer-list 3.3.3.3
#
ospf 1
 area 0.0.0.0
  network 4.4.4.4 0.0.0.0
  network 10.2.1.0 0.0.0.255
  network 192.168.2.0 0.0.0.255
#
return

配置集中式网关部署方式的VXLAN示例(BGP EVPN方式)

VXLAN_第3张图片

sysname Device1
#
e -instance evrf3 bd-mode # 配置e实例
 route-distinguisher 11:1
 -target 1:1 export-extcommunity
 -target 1:1 import-extcommunity
#
bridge-domain 10 # 配置BD绑定VNI和所属e实例
 vxlan vni 5010 split-horizon-mode
 e binding -instance evrf3
#
e -instance evrf4 bd-mode
 route-distinguisher 12:1
 -target 2:2 export-extcommunity
 -target 2:2 import-extcommunity
#
bridge-domain 20
 vxlan vni 5020 split-horizon-mode
 e binding -instance evrf4
#
interface GigabitEthernet1/0/1
 undo shutdown
 ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet1/0/2.1 mode l2
 encapsulation dot1q vid 10
 rewrite pop single
 bridge-domain 10
#
interface GigabitEthernet1/0/3.1 mode l2
 encapsulation dot1q vid 30
 rewrite pop single
 bridge-domain 20
#
interface LoopBack1
 ip address 2.2.2.2 255.255.255.255
#
interface Nve1
 source 2.2.2.2
 vni 5010 head-end peer-list protocol bgp # 对端列表从BGP获取
 vni 5020 head-end peer-list protocol bgp
#
bgp 100
 peer 3.3.3.3 as-number 100
 peer 3.3.3.3 connect-interface LoopBack1
 peer 4.4.4.4 as-number 100
 peer 4.4.4.4 connect-interface LoopBack1
 #
 ipv4-family unicast
  peer 3.3.3.3 enable
  peer 4.4.4.4 enable
 #
 l2-family e
  undo policy -target
  peer 3.3.3.3 enable
  peer 3.3.3.3 advertise encap-type vxlan
  peer 4.4.4.4 enable
  peer 4.4.4.4 advertise encap-type vxlan
#
ospf 1
 area 0.0.0.0
  network 2.2.2.2 0.0.0.0
  network 192.168.1.0 0.0.0.255
#
return
#
sysname Device2
#
e -instance evrf3 bd-mode
 route-distinguisher 21:1
 -target 1:1 export-extcommunity
 -target 1:1 import-extcommunity
#
bridge-domain 10
 vxlan vni 5010 split-horizon-mode
 e binding -instance evrf3
#
e -instance evrf4 bd-mode
 route-distinguisher 23:1
 -target 2:2 export-extcommunity
 -target 2:2 import-extcommunity
#
bridge-domain 20
 vxlan vni 5020 split-horizon-mode
 e binding -instance evrf4
#
interface Vbdif10
 ip address 192.168.10.10 255.255.255.0
#
interface Vbdif20
 ip address 192.168.20.10 255.255.255.0
#
interface GigabitEthernet1/0/1
 undo shutdown
 ip address 192.168.1.2 255.255.255.0
#
interface GigabitEthernet1/0/2
 undo shutdown
 ip address 192.168.2.1 255.255.255.0
#
interface LoopBack1
 ip address 3.3.3.3 255.255.255.255
#
interface Nve1
 source 3.3.3.3
 vni 5010 head-end peer-list protocol bgp #对端列表通过BGP获取
 vni 5020 head-end peer-list protocol bgp #对端列表通过BGP和获取
#
bgp 100
 peer 2.2.2.2 as-number 100
 peer 2.2.2.2 connect-interface LoopBack1
 peer 4.4.4.4 as-number 100
 peer 4.4.4.4 connect-interface LoopBack1
 #
 ipv4-family unicast
  peer 2.2.2.2 enable
  peer 4.4.4.4 enable
 #
 l2-family e
  peer 2.2.2.2 enable
  peer 2.2.2.2 advertise encap-type vxlan
  peer 4.4.4.4 enable
  peer 4.4.4.4 advertise encap-type vxlan
#
ospf 1
 area 0.0.0.0
  network 3.3.3.3 0.0.0.0
  network 192.168.1.0 0.0.0.255
  network 192.168.2.0 0.0.0.255
#
return
#
sysname Device3
#
e -instance evrf4 bd-mode
 route-distinguisher 31:2
 -target 2:2 export-extcommunity
 -target 2:2 import-extcommunity 
#
bridge-domain 20
 vxlan vni 5020 split-horizon-mode
 e binding -instance evrf4
#
interface GigabitEthernet1/0/1
 undo shutdown
 ip address 192.168.2.2 255.255.255.0
#
interface GigabitEthernet1/0/2.1 mode l2
 encapsulation dot1q vid 20
 rewrite pop single
 bridge-domain 20
#
interface LoopBack1
 ip address 4.4.4.4 255.255.255.255
#
interface Nve1
 source 4.4.4.4
 vni 5020 head-end peer-list protocol bgp #对端列表通过BGP获取
#
bgp 100
 peer 2.2.2.2 as-number 100
 peer 2.2.2.2 connect-interface LoopBack1
 peer 3.3.3.3 as-number 100
 peer 3.3.3.3 connect-interface LoopBack1
 #
 ipv4-family unicast
  peer 2.2.2.2 enable
  peer 3.3.3.3 enable
 #
 l2-family e
  undo policy -target
  peer 2.2.2.2 enable
  peer 2.2.2.2 advertise encap-type vxlan
  peer 3.3.3.3 enable
  peer 3.3.3.3 advertise encap-type vxlan
#
ospf 1
 area 0.0.0.0
  network 4.4.4.4 0.0.0.0
  network 192.168.2.0 0.0.0.255
#
return

配置分布式网关部署方式的VXLAN示例(BGP EVPN方式)

VXLAN分布式网关可解决VXLAN集中式网关的转发路径不优化、三层网关ARP表项规格瓶颈问题。
VXLAN_第4张图片

#
sysname Device1
#
isis 1
 network-entity 10.0000.0000.0001.00
#
interface GigabitEthernet1/0/0
 undo shutdown
 ip address 192.168.3.2 255.255.255.0
 isis enable 1
#
interface GigabitEthernet1/0/1
 undo shutdown
 ip address 192.168.2.2 255.255.255.0
 isis enable 1
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255
 isis enable 1
#
bgp 100
 peer 2.2.2.2 as-number 100
 peer 2.2.2.2 connect-interface LoopBack0
 peer 3.3.3.3 as-number 100
 peer 3.3.3.3 connect-interface LoopBack0
 #
 l2-family e
  undo policy -target
  peer 2.2.2.2 enable
  peer 2.2.2.2 advertise encap-type vxlan
  peer 2.2.2.2 advertise irb
  peer 2.2.2.2 reflect-client
  peer 3.3.3.3 enable
  peer 3.3.3.3 advertise encap-type vxlan
  peer 3.3.3.3 advertise irb
  peer 3.3.3.3 reflect-client
#
return
#
sysname Device2
#
isis 1
 network-entity 10.0000.0000.0002.00
#
ip -instance 1
 ipv4-family
  route-distinguisher 11:11
  apply-label per-instance
  -target 11:1 export-extcommunity e
  -target 11:1 import-extcommunity e
 vxlan vni 5010
#
e -instance evrf3 bd-mode
 route-distinguisher 10:1
 -target 11:1 export-extcommunity
 -target 11:1 import-extcommunity
#
bridge-domain 10
 vxlan vni 10 split-horizon-mode
 e binding -instance evrf3
#
interface Vbdif10
 ip binding -instance 1
 ip address 10.1.1.1 255.255.255.0
 arp collect host enable
 arp distribute-gateway enable
#
interface GigabitEthernet1/0/0
 undo shutdown
 ip address 192.168.2.1 255.255.255.0
 isis enable 1
#
interface GigabitEthernet1/0/1.1 mode l2
 encapsulation dot1q vid 10
 rewrite pop single
 bridge-domain 10
#
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255
 isis enable 1
#
interface Nve1
 source 2.2.2.2
 vni 10 head-end peer-list protocol bgp
#
bgp 100
 peer 1.1.1.1 as-number 100
 peer 1.1.1.1 connect-interface LoopBack0
 #
 l2-family e
  policy -target
  peer 1.1.1.1 enable
  peer 1.1.1.1 advertise encap-type vxlan
  peer 1.1.1.1 advertise irb
#
return
#
sysname Device3
#
isis 1
 network-entity 10.0000.0000.0003.00
#
ip -instance 1
 ipv4-family
  route-distinguisher 22:22
  apply-label per-instance
  -target 11:1 export-extcommunity e
  -target 11:1 import-extcommunity e
 vxlan vni 5010
#
e -instance evrf3 bd-mode
 route-distinguisher 20:1
 -target 11:1 export-extcommunity
 -target 11:1 import-extcommunity
#
bridge-domain 20
 vxlan vni 20 split-horizon-mode
 e binding -instance evrf3
#
interface Vbdif20
 ip binding -instance 1
 ip address 10.2.1.1 255.255.255.0
 arp collect host enable
 arp distribute-gateway enable
#
interface GigabitEthernet1/0/0
 undo shutdown
 ip address 192.168.3.1 255.255.255.0
 isis enable 1
#
interface GigabitEthernet1/0/1.1 mode l2
 encapsulation dot1q vid 20
 rewrite pop single
 bridge-domain 20
#
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255
 isis enable 1
#
interface Nve1
 source 3.3.3.3
 vni 20 head-end peer-list protocol bgp
#
bgp 100
 peer 1.1.1.1 as-number 100
 peer 1.1.1.1 connect-interface LoopBack0
 #
 l2-family e
  policy -target
  peer 1.1.1.1 enable
  peer 1.1.1.1 advertise encap-type vxlan
  peer 1.1.1.1 advertise irb
#
return

VXLAN_第5张图片
一个ip 可以包含多个EVPN,一个EVPN可以包含多个BD??

你可能感兴趣的:(Datacom,网络,运维,服务器)