scapy 查找自己的网卡(默认网卡)

def GetInterface():
    from scapy.config import conf
    from scapy.route import Route

    conf.route.resync()
    return  conf.route.route('0.0.0.0')[0]

if __name__ == '__main__':
    print(GetInterface())

  

原文地址:https://www.cnblogs.com/jackadam/p/14320628.html