CE1和CE4建立Vxlan隧道有两种方式
- CE1和CE4直接建立EVPN对等体,建立Vxlan隧道
- CE1和CE4不直接建立EVPN对等体,通过和CE2、CE3建立EVPN对等体传递EVPN路由使得CE1与CE4建立Vxlan隧道(CE2、CE3传递时不修改路由的下一跳地址)
注:本次实验做的是跨子网互访的实验
命令的含义在DCN内建立Vxlan隧道时已经讲解,本次只书写实验思路与命令
端到端方式与分段式方式的配置有类似的地方,可以互相对比一下
(端到端方式是CE1与CE4直接建立Vxlan隧道,要求中途传递路由时不能修改下一跳,分段式是分段建立Vxlan隧道,中途要求修改下一跳地址)这大概就是配置上的差距了
目录
配置CE设备的IP地址并使得CE1、CE4的VTEP地址可达
基本配置
配置LSW1、LSW2的Vlan
LSW1
vlan 10
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10
LSW2
vlan 20
interface GigabitEthernet0/0/1
port link-type access
port default vlan 20
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20
配置CE设备的IP地址并使得CE1、CE4的VTEP地址可达
CE1
interface GE1/0/0
undo portswitch
undo shutdown
ip address 10.0.12.1 255.255.255.0
interface LoopBack0
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 10.0.12.0 0.0.0.255
CE2
interface GE1/0/0
undo portswitch
undo shutdown
ip address 10.0.12.2 255.255.255.0
interface GE1/0/1
undo portswitch
undo shutdown
ip address 10.0.25.2 255.255.255.0
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
ospf 1
default-route-advertise always
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 10.0.12.0 0.0.0.255
ip route-static 0.0.0.0 0.0.0.0 10.0.25.5
CE3
interface GE1/0/0
undo portswitch
undo shutdown
ip address 10.0.34.3 255.255.255.0
interface GE1/0/1
undo portswitch
undo shutdown
ip address 10.0.35.3 255.255.255.0
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
ospf 1
default-route-advertise always
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 10.0.34.0 0.0.0.255
ip route-static 0.0.0.0 0.0.0.0 10.0.35.5
CE4
interface GE1/0/1
undo portswitch
undo shutdown
ip address 10.0.34.4 255.255.255.0
interface LoopBack0
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 10.0.34.0 0.0.0.255
AR1
int g0/0/1
ip add 10.0.25.5 24
int g0/0/0
ip add 10.0.35.5 24
ip route-static 1.1.1.1 32 10.0.25.2
ip route-static 4.4.4.4 32 10.0.35.3
配置EVPN对等体
CE1与CE2、CE2与CE3、CE3与CE4建立EVPN对等体
evpn-overlay enable
CE1
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0
ipv4-family unicast
peer 2.2.2.2 enable
l2vpn-family evpn
policy vpn-target
peer 2.2.2.2 enable
peer 2.2.2.2 advertise irb
CE2
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack0
peer 10.0.35.3 as-number 200
peer 10.0.35.3 ebgp-max-hop 10
ipv4-family unicast
peer 1.1.1.1 enable
peer 10.0.35.3 enable
l2vpn-family evpn
policy vpn-target
peer 1.1.1.1 enable
peer 1.1.1.1 advertise irb
peer 1.1.1.1 next-hop-invariable
传递EVPN路由时不更改路由下一跳(保证了是1.1.1.1与4.4.4.4建立隧道)
peer 10.0.35.3 enable
peer 10.0.35.3 advertise irb
peer 10.0.35.3 next-hop-invariable
CE3
bgp 200
peer 4.4.4.4 as-number 200
peer 4.4.4.4 connect-interface LoopBack0
peer 10.0.25.2 as-number 100
peer 10.0.25.2 ebgp-max-hop 10
ipv4-family unicast
peer 4.4.4.4 enable
peer 10.0.25.2 enable
l2vpn-family evpn
policy vpn-target
peer 4.4.4.4 enable
peer 4.4.4.4 advertise irb
peer 4.4.4.4 next-hop-invariable
peer 10.0.25.2 enable
peer 10.0.25.2 advertise irb
peer 10.0.25.2 next-hop-invariable
CE4
bgp 200
peer 3.3.3.3 as-number 200
peer 3.3.3.3 connect-interface LoopBack0
ipv4-family unicast
peer 3.3.3.3 enable
l2vpn-family evpn
policy vpn-target
peer 3.3.3.3 enable
peer 3.3.3.3 advertise irb
配置L3VPN实例与三层VNI
配置L3VPN实例用来传递EVPN路由(CE1、CE2、CE3、CE4配置相同)
ip vpn-instance A
ipv4-family
route-distinguisher 1:100
vpn-target 1:100 export-extcommunity evpn
vpn-target 1:100 import-extcommunity evpn
vxlan vni 100
CE1与CE4建立Vxlan隧道
蓝色CE1配置、绿色CE4配置
配置BD域与二层VNI
bridge-domain 10
vxlan vni 10
evpn
route-distinguisher 1:10
vpn-target 1:10 export-extcommunity
vpn-target 1:100 export-extcommunity
vpn-target 1:10 import-extcommunity
bridge-domain 20
vxlan vni 20
evpn
route-distinguisher 1:20
vpn-target 1:20 export-extcommunity
vpn-target 1:100 export-extcommunity
vpn-target 1:20 import-extcommunity
vpn-target 1:100 import-extcommunity
配置VTEP接口
interface Nve1
source 1.1.1.1
interface Nve1
source 4.4.4.4
配置Vbdif接口
interface Vbdif10
ip binding vpn-instance A
ip address 192.168.1.254 255.255.255.0
vxlan anycast-gateway enable
arp collect host enable
interface Vbdif20
ip binding vpn-instance A
ip address 192.168.2.254 255.255.255.0
vxlan anycast-gateway enable
arp collect host enable
配置Vxlan业务接入
interface GE1/0/1.10 mode l2
encapsulation dot1q vid 10
bridge-domain 10
interface GE1/0/0.10 mode l2
encapsulation dot1q vid 20
bridge-domain 20