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())