pktgen-dpdk 进行rfc2544测试

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wangcg123/article/details/88112793

L2

把dstip和srcip 设置为同一网段的2个ip即可

L3

把dst mac设置成待测设备的网口mac,dst ip为pktgen另一网口的ip

比如: 41.2 => "68:05:CA:47:58:79"  =>    "68:05:CA:47:2B:9E"      =>42.2

。。。  。。。

local ip_send   = "192.168.41.2";
local ip_recv   = "192.168.42.2";
local dstmac_send       = "68:05:CA:47:58:79";
local dstmac_recv       = "68:05:CA:47:2B:9E";

。。。  。。。

pktgen.set_ipaddr(sendport, "dst", ip_recv);
pktgen.set_ipaddr(sendport, "src", ip_send..netmask);
pktgen.set_mac(sendport, dstmac_send);

pktgen.set_ipaddr(recvport, "dst", ip_send);
pktgen.set_ipaddr(recvport, "src", ip_recv..netmask);
pktgen.set_mac(recvport, dstmac_recv);

-- 最主要的,enable garp,响应被测设备的arp request
pktgen.garp(sendport, "enable"); 
 

猜你喜欢

转载自blog.csdn.net/wangcg123/article/details/88112793