3层vni vxlan_配置三段式VXLAN实现三层互通示例

Spine1的配置文件

#

sysname Spine1

#

interface GE0/1/0

undo shutdown

ip address 192.168.10.1 255.255.255.0

#

interface GE0/2/0

undo shutdown

ip address 192.168.20.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.10.0 0.0.0.255

network 192.168.20.0 0.0.0.255

#

return

Leaf1的配置文件

#

sysname Leaf1

#

ip -instance 1

ipv4-family

route-distinguisher 11:11

-target 1:1 export-extcommunity

-target 11:1 export-extcommunity e

-target 1:1 import-extcommunity

-target 11:1 import-extcommunity e

vxlan vni 5010

#

e -instance evrf1 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 evrf1

#

interface Vbdif10

ip binding -instance 1

ip address 10.1.1.1 255.255.255.0

arp distribute-gateway enable

arp collect host enable

#

interface GE0/1/0

undo shutdown

ip address 192.168.10.2 255.255.255.0

#

interface GE0/2/0

shutdown

#

interface GE0/2/0.1 mode l2

encapsulation dot1q vid 10

rewrite pop single

bridge-domain 10

#

interface LoopBack1

ip address 5.5.5.5 255.255.255.255

#

interface Nve1

source 5.5.5.5

vni 10 head-end peer-list protocol bgp

#

bgp 100

peer 6.6.6.6 as-number 100

peer 6.6.6.6 connect-interface LoopBack1

#

l2-family e

undo policy -target

peer 6.6.6.6 enable

peer 6.6.6.6 advertise encap-type vxlan

peer 6.6.6.6 advertise irb

#

ospf 1

area 0.0.0.0

network 5.5.5.5 0.0.0.0

network 192.168.10.0 0.0.0.255

#

return

Leaf2的配置文件

#

sysname Leaf2

#

ip -instance 1

ipv4-family

route-distinguisher 11:11

-target 1:1 export-extcommunity

-target 11:1 export-extcommunity e

-target 1:1 import-extcommunity

-target 11:1 import-extcommunity e

vxlan vni 5010

#

e -instance evrf1 bd-mode

route-distinguisher 10:1

-target 11:1 export-extcommunity

-target 11:1 import-extcommunity

#

bridge-domain 20

vxlan vni 20 split-horizon-mode

e binding -instance evrf1

#

interface Vbdif20

ip binding -instance 1

ip address 20.1.1.1 255.255.255.0

arp distribute-gateway enable

arp collect host enable

#

interface GE0/1/0

undo shutdown

ip address 192.168.20.2 255.255.255.0

#

interface GE0/2/0

shutdown

#

interface GE0/2/0.1 mode l2

encapsulation dot1q vid 20

rewrite pop single

bridge-domain 20

#

interface 0/3/0

undo shutdown

ip address 192.168.50.2 255.255.255.0

#

interface LoopBack1

ip address 6.6.6.6 255.255.255.255

#

interface Nve1

source 6.6.6.6

vni 20 head-end peer-list protocol bgp

#

bgp 100

peer 5.5.5.5 as-number 100

peer 5.5.5.5 connect-interface LoopBack1

peer 192.168.60.2 as-number 200

peer 192.168.60.2 ebgp-max-hop 255

#

l2-family e

undo policy -target

peer 5.5.5.5 enable

peer 5.5.5.5 advertise encap-type vxlan

peer 5.5.5.5 advertise irb

peer 5.5.5.5 import reoriginate

peer 5.5.5.5 advertise route-reoriginated e mac-ip

peer 192.168.60.2 enable

peer 192.168.60.2 advertise encap-type vxlan

peer 192.168.60.2 advertise irb

peer 192.168.60.2 import reoriginate

peer 192.168.60.2 advertise route-reoriginated e mac-ip

#

ospf 1

area 0.0.0.0

network 6.6.6.6 0.0.0.0

network 192.168.20.0 0.0.0.255

network 192.168.50.0 0.0.0.255

#

return

Spine2的配置文件

#

sysname Spine2

#

interface GE0/1/0

undo shutdown

ip address 192.168.30.1 255.255.255.0

#

interface GE0/2/0

undo shutdown

ip address 192.168.40.1 255.255.255.0

#

interface LoopBack1

ip address 4.4.4.4 255.255.255.255

#

ospf 1

area 0.0.0.0

network 4.4.4.4 0.0.0.0

network 192.168.30.0 0.0.0.255

network 192.168.40.0 0.0.0.255

#

return

Leaf3的配置文件

#

sysname Leaf3

#

ip -instance 1

ipv4-family

route-distinguisher 11:11

-target 1:1 export-extcommunity

-target 11:1 export-extcommunity e

-target 1:1 import-extcommunity

-target 11:1 import-extcommunity e

vxlan vni 5010

#

e -instance evrf1 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 evrf1

#

interface Vbdif10

ip binding -instance 1

ip address 30.1.1.1 255.255.255.0

arp distribute-gateway enable

arp collect host enable

#

interface GE0/1/0

undo shutdown

ip address 192.168.30.2 255.255.255.0

#

interface GE0/2/0

shutdown

#

interface GE0/2/0.1 mode l2

encapsulation dot1q vid 10

rewrite pop single

bridge-domain 10

#

interface GE0/3/0

undo shutdown

ip address 192.168.60.2 255.255.255.0

#

interface LoopBack1

ip address 7.7.7.7 255.255.255.255

#

interface Nve1

source 7.7.7.7

vni 10 head-end peer-list protocol bgp

#

bgp 200

peer 8.8.8.8 as-number 200

peer 8.8.8.8 connect-interface LoopBack1

peer 192.168.50.2 as-number 100

peer 192.168.50.2 ebgp-max-hop 255

#

l2-family e

undo policy -target

peer 8.8.8.8 enable

peer 8.8.8.8 advertise encap-type vxlan

peer 8.8.8.8 advertise irb

peer 8.8.8.8 import reoriginate

peer 8.8.8.8 advertise route-reoriginated e mac-ip

peer 192.168.50.2 enable

peer 192.168.50.2 advertise encap-type vxlan

peer 192.168.50.2 advertise irb

peer 192.168.50.2 import reoriginate

peer 192.168.50.2 advertise route-reoriginated e mac-ip

#

ospf 1

area 0.0.0.0

network 7.7.7.7 0.0.0.0

network 192.168.30.0 0.0.0.255

network 192.168.60.0 0.0.0.255

#

return

Leaf4的配置文件

#

sysname Leaf4

#

ip -instance 1

ipv4-family

route-distinguisher 11:11

-target 1:1 export-extcommunity

-target 11:1 export-extcommunity e

-target 1:1 import-extcommunity

-target 11:1 import-extcommunity e

vxlan vni 5010

#

e -instance evrf1 bd-mode

route-distinguisher 10:1

-target 11:1 export-extcommunity

-target 11:1 import-extcommunity

#

bridge-domain 20

vxlan vni 20 split-horizon-mode

e binding -instance evrf1

#

interface Vbdif20

ip binding -instance 1

ip address 40.1.1.1 255.255.255.0

arp distribute-gateway enable

arp collect host enable

#

interface GE0/2/0

shutdown

#

interface GE0/1/0

undo shutdown

ip address 192.168.40.2 255.255.255.0

#

interface GE0/2/0.1 mode l2

encapsulation dot1q vid 20

rewrite pop single

bridge-domain 20

#

interface LoopBack1

ip address 8.8.8.8 255.255.255.255

#

interface Nve1

source 8.8.8.8

vni 20 head-end peer-list protocol bgp

#

bgp 200

peer 7.7.7.7 as-number 200

peer 7.7.7.7 connect-interface LoopBack1

#

l2-family e

undo policy -target

peer 7.7.7.7 enable

peer 7.7.7.7 advertise encap-type vxlan

peer 7.7.7.7 advertise irb

#

ospf 1

area 0.0.0.0

network 8.8.8.8 0.0.0.0

network 192.168.40.0 0.0.0.255

#

return

Device1的配置文件

#

sysname Device1

#

interface GE0/1/0

undo shutdown

ip address 192.168.50.1 255.255.255.0

#

interface GE0/2/0

undo shutdown

ip address 192.168.1.1 255.255.255.0

#

interface LoopBack1

ip address 1.1.1.1 255.255.255.255

#

ospf 1

area 0.0.0.0

network 1.1.1.1 0.0.0.0

network 192.168.1.0 0.0.0.255

network 192.168.50.0 0.0.0.255

#

return

Device2的配置文件

#

sysname Device2

#

interface GE0/1/0

undo shutdown

ip address 192.168.60.1 255.255.255.0

#

interface GE0/2/0

undo shutdown

ip address 192.168.1.2 255.255.255.0

#

interface LoopBack1

ip address 2.2.2.2 255.255.255.255

#

ospf 1

area 0.0.0.0

network 1.1.1.1 0.0.0.0

network 192.168.1.0 0.0.0.255

network 192.168.60.0 0.0.0.255

#

return

你可能感兴趣的:(3层vni,vxlan)