Low Power Wide Area Networks (LPWAN) enable a growing number of Internet-of-Things (IoT) applications with large geographical coverage, low bit-rate, and long lifetime requirements. LoRa (Long Range) is a well-known LPWAN technology that uses a proprietary Chirp Spread Spectrum (CSS) physical layer, while the upper layers are defined by an open standard—LoRaWAN. In this paper, we propose a simple yet effective method to improve the Quality-of-Service (QoS) of LoRaWAN networks by fine-tuning specific radio parameters. Through a Mixed Integer Linear Programming (MILP) problem formulation, we find optimal settings for the Spreading Factor (SF) and Carrier Frequency (CF) radio parameters, considering the network traffic specifications as a whole, to improve the Data Extraction Rate (DER) and to reduce the packet collision rate and the energy consumption in LoRa networks. The effectiveness of the optimization procedure is demonstrated by simulations, using LoRaSim for different network scales. In relation to the traditional LoRa radio parameter assignment policies, our solution leads to an average increase of 6% in DER, and a number of collisions 13 times smaller. In comparison to networks with dynamic radio parameter assignment policies, there is an increase of 5%, 2.8%, and 2% of DER, and a number of collisions 11, 7.8 and 2.5 times smaller than equal-distribution, Tiurlikova’s (SOTA), and random distribution, respectively. Regarding the network energy consumption metric, the proposed optimization obtained an average consumption similar to Tiurlikova’s, and 2.8 times lower than the equal-distribution and random dynamic allocation policies. Furthermore, we approach the practical aspects of how to implement and integrate the optimization mechanism proposed in LoRa, guaranteeing backward compatibility with the standard protocol.