[i=s] 本帖最后由 cfplzjc 于 2026-11-8 22:47 编辑 [/i]
一、BPF工具的使用
本次聚焦BPF工具和流量观察,不对原理和实验结果做过多赘述。
(1)初始对协议等参数不清楚的情况下,建议使用协议过滤,比如过滤内层vxlan封装的源=10.18.1.10-->目的=10.18.2.10的数据包,由于链路上还存在不带vxlan裸ip封装,配置如下


(2)反向解析,比如已经有一个filter语句,可以进行反向解析,并生成新的filter语句,比如最常用的,正向request语句生成,想生成反向reply语句,可参考这个方法。



(3)遇到filter不生效,建议先放大范围,匹配数据,然后再进一步缩小范围,比如只保留红框部分进行测试。

一、园区网
由于园区S交换机在802.1x和portal认证等功能上有缺失,这里选用AR6700v-L作为802.1x认证控制点和网关,AR1000v作为porta认证控制点和网关,无线采用华三VAC+真实AP仿真无线portal认证试验。
注:本次暂未做流量测试,等云杉S交换机补齐认证功能,做二次扩展测试。

二、数据中心
1、第1种组网,网络虚拟化,一般是华为提供网络提供vxlan隧道,对接友商虚拟化平台,如VMware Vcenter。网络和计算解耦

2、这里的流量模型比较简单,大致为以下几种
(1)DC01租户A访问出口PE
filter
request:(ip and udp port 4789 and ether[76:4] == 0xC0A8010A and ether[80:4] == 0x58010101) or (icmp and src host 192.168.1.10 and dst host 88.1.1.1)
reply:ip and udp port 4789 and ether[76:4] == 0x58010101 and ether[80:4] == 0x3F57FEF6 or (icmp and src host 88.1.1.1 and dst host 192.168.1.10)

(2)DC02租户B访问出口PE
filter
request:ip and udp port 4789 and ether[76:4] == 0x3F57FDF6 and ether[80:4] == 0x58010101 or (icmp and src host 192.168.2.10 and dst host 88.1.1.1)
reply:ip and udp port 4789 and ether[76:4] == 0x59010101 and ether[80:4] == 0x3E57FEF6 or (icmp and src host 89.1.1.1 and dst host 193.168.1.10)

(4)跨DC租户A跨子网互访
filter
request:ip src host 192.168.1.10 and ip dst host 193.168.1.10 or (ip and udp port 4789 and ether[76:4] == 0xC0A8010A and ether[80:4] == 0xC1A8010A) or (icmp and src host 192.168.1.10 and dst host 193.168.1.10) or (vlan)
reply:ip src host 193.168.1.10 and ip dst host 192.168.1.10 or (ip and udp port 4789 and ether[76:4] == 0x3E57FEF6 and ether[80:4] == 0x3F57FEF6) or (icmp and src host 193.168.1.10 and dst host 192.168.1.10) or (vlan)

(5)跨DC租户A同子网互访
filter
request: icmp and src host 192.168.1.10 and dst host 192.168.1.11 or udp port 4789
reply: icmp and src host 192.168.1.11 and dst host 192.168.1.10 or udp port 4789

2、第2种组网,华为自研的私有云解决方案HCS,配置参考8.3.1,网络提供底层underlay可达,由计算节点、网络节点、L3GW、裸金属BMS Leaf提供vxlan隧道,俗称type Ⅱ,即软SDN

(1)VPC-Peering,用于分属不同vpc内的主机互访
①预期流量模型,计算节点和vRouter节点创建2条vxlan隧道,数据包发送至vRouter后进行vxlan解封装,查路由后,重新封装。由于NE8000不支持跨VRF路由通信,这里外接一台vRouter-inter引流实现(实际不需要)

②filter语句
request:(ip src host 10.18.1.10 and ip dst host 10.18.2.10) or ( udp port 4789 and ether[76:4] == 0x0A12010A and ether[80:4] == 0x0A12020A) or (vlan 12 and src host 10.18.1.10 and dst host 10.18.2.10)
replay:src host 10.18.2.10 and dst host 10.18.1.10 or (udp port 4789 and ether[76:4] == 0x0A12020A and ether[80:4] == 0x0A12010A) or (vlan 12 and src host 10.18.2.10 and dst host 10.18.1.10)
③流量图,深蓝代表请求流量路径,橄榄绿代表回应流量路径

④traceroute -n 10.18.2.10进行复核,路径符合预期

(2)弹性EIP,一般用于云网主机访问云内映射服务器场景使用,1对1映射。
①预期流量模型,云外PE充当云外一台主机,流量先送至BR,BR进行vxlan封装,在ENAT进行解封装,将内层报文的目的IP转换成真实IP,重新进行vxlan封装,到达计算节点进行vxlan解封装

②filter语句
request:src 89.1.1.1 or (udp port 4789 and ether[80:4] == 0x0A12010A) or (vlan and src 89.1.1.1)
reply:dst host 89.1.1.1 or (udp port 4789 and ether[80:4] == 0x0A12010A) or (vlan and dst host 89.1.1.1)
③流量图,金黄色代表请求流量,橄榄绿代表回应流量

④tracert结果符合预期

(3)INAT:内大网流量,计算节点访问管理区一些服务时,进行源NAT转换。
①预期流量模型:数据在计算节点进行vxlan封装,到达网络节点INAT进行vxlan解封装,进行源NAT转换,通过public网路路由到Border Leaf,Border通过明细路由引流到FW,FW查询路由后,跨zone转到DMZ,回送到Border的DMZ_VRF,查路由后发给管理区Leaf

②filter语句
request:dst 8.8.8.8 or (udp port 4789 and ether[80:4] == 0x08080808) or ( vlan and dst 8.8.8.8)
reply:src host 8.8.8.8 or (udp src port 4789 and ether[76:4] == 0x08080808) or (vlan and src host 8.8.8.8)
③流量图,紫色代表请求流量,橄榄绿代表回应流量

④tracert路径符合预期

(4)ELB-L4,四层应用负载均衡测试,这里用ftp协议
①流量模型:云外主机通过Intenet_VRF路由至网络节点BR,BR节点进行vxlan封装,查路由发到cvs节点,解封装同时进行目的NAT转换,转换后重新进行vxlan封装,采用算法负载到后台真实计算节点,到达计算节点进行vxlan解封装。

②filter语句
request:src host 88.1.1.10 or src host 88.1.1.20 or (udp port 4789 and ether[80:4] == 0x53EC99F6) or (vlan and src host 88.1.1.10)
reply:dst host 88.1.1.10 or dst 88.1.1.20 or (udp port 4789 and ether[80:4] == 0x53EC99F6) or (vlan and dst host 88.1.1.10)
③深红代表请求流量,橄榄绿代表回应流量

④tracert路径符合预期

(5)ELB-L7,七层负载均衡测试,采用HTTP协议
①流量模型:云外PC通过Internet_VRF路由至BR,在BR节点进行vxlan封装,查路由,送到CVS节点,进行FULL NAT转换,重新进行vxlan封装通过负载均衡算法发给Nginx节点,到达Nginx节点进行vxlan解封装,再次进行FULL NAT转换,重新进行vxlan封装通过负载均衡发给内部真实计算节点。

②filter语句
request:src host 88.1.1.10 or src host 88.1.1.20 or (udp port 4789 and ether[80:4] == 0x53EC99F6) or (vlan and src host 88.1.1.10)
reply:dst host 88.1.1.10 or dst 88.1.1.20 or (udp port 4789 and ether[80:4] == 0x53EC99F6) or (vlan and dst host 88.1.1.10)
③深红代表请求流量,橄榄绿代表回应流量

④tracert路径符合预期

(6)增强型云专线,用于提供企业分支通过VPN拨入
①流量模型:L3GW和云内节点搭建vxlan隧道,云外分支通过L3GW网关访问云内服务。

②filter语句
request:udp port 4789 and (udp[12:4] & 0xffffff00) = 0x00006400 and ether[73] = 1 and ether[76:4] = 0x0a12010a and ether[80:4] = 0x63010101 and src host 172.100.2.11 and dst host 172.100.2.1 or (vlan 101 and src host 10.18.1.10 and dst host 99.1.1.1)
reply:udp port 4789 and udp[12 & 0xffffff00:4] = 0x00006400 and ether[73] = 1 and ether[76:4] = 0x539BFDFF and ether[80:4] = 0x539BFDF5 and src host 172.100.2.1 and dst host 172.100.2.11 or (vlan 101 and src host 99.1.1.1 and dst host 10.18.1.10)
③黑色代表请求流量,橄榄绿代表回应流量

④tracert符合预期

(7)裸金属访问OBS
①流量模型,裸金属节点通过裸金属leaf进行vxlan封装,路由到L3GW进行vxlan解封装,查路由通过Pullic_VRF进行转发,回到OBS-Leaf

②filter语句
request: udp port 4789 and ether[76:4] == 0x0A12060A and ether[80:4] == 0x0A12070A or (icmp and src host 10.18.6.10 and dst host 10.18.7.10) or (vlan 13)
reply: udp port 4789 and ether[76:4] == 0x0A12070A and ether[80:4] == 0x0A12060A or (icmp and src host 10.18.7.10 and dst host 10.18.6.10) or (vlan 13)
③棕色代表请求流量,橄榄绿代表回应流量

④tracert路径

三、广域网
广域网经过这10年(2015-->2025)不断迭代变迁,主要痛点和述求是智能选路,由传统MPLS VPN变迁至智能SD-WAN,智能SD-WAN底层underlay的路由可达还是受限于传统BGP,针对此,进一步迭代到下一代SRv6。SD-WAN可采用华为+友商结合的方式,比较适合于中小客户,SRv6适合于大型客户,需全套NE8000设备+NCE-IP控制器
1、传统MPLS VPN组网
以VPNA为例。192.168.1.10--->192.168.2.10
request:src host 192.168.1.10 and dst host 192.168.2.10 or (mpls and (src host 192.168.1.10 and dst host 192.168.2.10) or (mpls and src host 192.168.1.10 and dst host 192.168.2.10))
reply:src host 192.168.2.10 and dst host 192.168.1.10 or (mpls and src host 192.168.2.10 and dst host 192.168.1.10) or (mpls and src host 192.168.2.10 and dst host 192.168.1.10)


2、SD-WAN组网
request src host 192.168.1.10 and dst host 192.168.3.10 or (ip proto 47)
reply:src host 192.168.1.30 and dst host 192.168.1.10 or (ip proto 47)

3、SRv6组网
request:(icmp and src host 1.1.1.1 and dst host 3.3.3.3) or (ether[12:2] == 0x86dd and ether[20] == 4 and ether[54] & 0xf0 == 0x40 and ether[63] == 1 and ether[66:4] == 0x01010101 and ether[70:4] == 0x03030303) or (ether[12:2] == 0x86dd and ether[20] == 43 and ether[55] == 8 and ether[126] & 0xf0 == 0x40 and ether[135] == 1 and ether[138:4] == 0x01010101 and ether[142:4] == 0x03030303)
reply:(ip and src host 1.1.1.1 and dst host 3.3.3.3) or (ether[12:2] == 0x86dd and ether[20] == 4 and ether[54] & 0xf0 == 0x40 and ether[66:4] == 0x01010101 and ether[70:4] == 0x03030303) or (ether[12:2] == 0x86dd and ether[20] == 43 and ether[55] == 8 and ether[126] & 0xf0 == 0x40 and ether[138:4] == 0x01010101 and ether[142:4] == 0x03030303)

