socket类型设置 s32 rawsock=0; rawsock=socket(PF_ANET,SOCK_RAW,htons(ETH_P_ALL)); //尤其注意bind的时候也需要设置为ETH_P_ALL 网卡设置 开启网卡的混杂模式 ifconfig eth0 promisc