我try 使用Scapy配置L3套接字,如:
from scapy.all import *
soc = conf.L3socket(iface="eth1")
当我在Ubuntu VM中使用此代码时,一切都正常,但当我在WSL中使用此代码时,我遇到了一个错误:
/usr/local/lib/python3.10/dist-packages/scapy/layers/ipsec.py:471: CryptographyDeprecationWarning: Blowfish has been deprecated
cipher=algorithms.Blowfish,
/usr/local/lib/python3.10/dist-packages/scapy/layers/ipsec.py:485: CryptographyDeprecationWarning: CAST5 has been deprecated
cipher=algorithms.CAST5,
Traceback (most recent call last):
File "........./python/test.py", line 2, in <module>
soc = conf.L3socket(iface="eth1")
File "/usr/local/lib/python3.10/dist-packages/scapy/arch/linux.py", line 486, in __init__
self.ins = socket.socket(
File "/usr/lib/python3.10/socket.py", line 232, in __init__
_socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol
我怎样才能解决这个问题?