def default_interface
      ip = default_ip
      Socket.getifaddrs.each do |ifaddr|
        next unless ifaddr.addr.ip?
        return ifaddr.name if ifaddr.addr.ip_address == ip
      end
      # Fall back to libpcap as last resort
      return Pcap.lookupdev
    end
def default_interface
      ip = default_ip
      Socket.getifaddrs.each do |ifaddr|
        next unless ifaddr.addr.ip?
        return ifaddr.name if ifaddr.addr.ip_address == ip
      end
      # Fall back to libpcap as last resort
      return Pcap.lookupdev
    end
Determine the default routeable interface, taken from packetfu's utils.rb