5.7、模拟外部和服务器之间Ping
本文简要分析实验中外部和服务器之间Ping的过程。
路由都已经配置完成,
R1:
#
#配置去往服务器的路由,下一跳指向BL1
#
ip route-static 10.10.10.0 255.255.255.0 182.1.1.1
ip route-static 172.16.1.0 255.255.255.0 182.1.1.1
ip route-static 192.168.0.0 255.255.0.0 182.1.1.1
#
BL1:
静态路由注入BGP:
#
bgp 100
router-id 4.4.4.4
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack0
#
ipv4-family unicast
peer 1.1.1.1 enable
#
ipv4-family vpn-instance vpn1
import-route direct <-----------------------直连端口网段注入BGP
advertise l2vpn evpn
#
l2vpn-family evpn
policy vpn-target
peer 1.1.1.1 enable
peer 1.1.1.1 advertise irb
#
通过bgp evpn type 5 prefix-route update, BL1、Leaf1、Leaf2相同VPN(相同L3VNI)都相互学习到各自的路由(此时服务器主机路由还没有学习到)。
5.7.1 R1和Serv2之间Ping

R1和Serv2 Ping通过程比较简单,直接查询路由即可。
(1) R1 Ping Serv2
1、R1发起Ping 10.10.10.10(源地址为182.1.1.2),第一个icmp(icmp1)根据静态路由送到BL1
2、BL1查询vpn1的路由表,10.10.10.10的next-hop为20.20.20.20,进行vxlan封装:
[BL1]dis ip routing-table vpn-instance vpn1 10.10.10.10
Proto: Protocol Pre: Preference
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table : vpn1
Summary Count : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.10.10.0/24 IBGP 255 0 RD 20.20.20.20 VXLAN
[BL1]
于是用L3VNI 100,进行vxlan封装,送到Leaf1
3、Leaf1查询vpn1的路由表(通过L3VNI 100关联到的),需从网关10.10.10.1端口送出,此时10.10.10.1如果没有10.10.10.10的mac1,所以发出arp1,并得到arp1 reply。此时icmp1 time out。
4、再次发出icmp request(简称icmp2),可顺利到达10.10.10.10。
5、10.10.10.10发出的icmp reply,到达Leaf1后,查询vpn1路由表,182.1.1.0/24 next-hop为40.40.40.40, 进行vxlan封装,送到BL1。
[Leaf1]dis ip routing-table vpn-instance vpn1 182.1.1.0
Proto: Protocol Pre: Preference
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table : vpn1
Summary Count : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
182.1.1.0/24 IBGP 255 0 RD 40.40.40.40 VXLAN
6、BL1再查vpn1路由表,最终送达182.1.1.1。
至此顺利Ping通。
如果一开始ping不通,可能是ensp bug导致,可以进行undo bridge-domain/bridge-domain操作。另外可以看到网关10.10.10.1的端口发出一个ARP Announcement,可以了解一下:

Frame 49: 70 bytes on wire (560 bits), 70 bytes captured (560 bits) on interface -, id 0
Ethernet II, Src: HuaweiTe_da:58:76 (70:7b:e8:da:58:76), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 20
000. .... .... .... = Priority: Best Effort (default) (0)
...0 .... .... .... = DEI: Ineligible
.... 0000 0001 0100 = ID: 20
Type: ARP (0x0806)
Padding: 0000000000000000000000000000
Trailer: 00000000000000000000
Address Resolution Protocol (ARP Announcement)
Hardware type: Ethernet (1)
Protocol type: IPv4 (0x0800)
Hardware size: 6
Protocol size: 4
Opcode: request (1)
[Is gratuitous: Tr

本文详细解析了在EVPN环境下,R1与服务器Serv2、Serv1之间的Ping通信过程。通过配置路由和BGP协议,实现了不同网络间的路由学习和VXLAN封装,确保ICMP请求能正确抵达目标并返回。过程中涉及ARP请求、响应、BGP EVPN Type2 IRB路由更新等关键步骤,展示了EVPN在分布式网关下的工作机制。
最低0.47元/天 解锁文章
2070

被折叠的 条评论
为什么被折叠?



