您可以这样 *** 作:
sudo ethtool -K eth1 tx off
然后从python 2发送您的躲避帧(您必须自己转换为Python 3):
#!/usr/bin/env pythonfrom socket import socket, AF_PACKET, SOCK_RAWs = socket(AF_PACKET, SOCK_RAW)s.bind(("eth1", 0))# We're putting together an ethernet frame here, # but you could have anything you want instead# Have a look at the 'struct' module for more # flexible packing/unpacking of binary data# and 'binascii' for 32 bit CRCsrc_addr = "x01x02x03x04x05x06"dst_addr = "x01x02x03x04x05x06"payload = ("["*30)+"PAYLOAD"+("]"*30)checksum = "x1ax2bx3cx4d"ethertype = "x08x01"s.send(dst_addr+src_addr+ethertype+payload+checksum)
做完了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)