University campus networks need wired (ethernet) and dense wireless fidelity networks that have devices like access points, switches, and routers that are always turned on. Consequently, they generate two important problems: the energy bill and the influence of carbon dioxide into the atmosphere. Energy savings are the solution to those problems. There are several proposals to augment the energy savings separately in ethernet and wireless fidelity, but there is no integrated method to simultaneously reduce them in both parts of the networks. Our novel method combines idle cycling and machine learning techniques to efficiently obtain energy savings in both parts of the network simultaneously. We categorize network devices into two groups: (a) those that are always turned on and (b) those that can be dynamically turned on or off based on network performance. We formulated two algorithms that decide when to turn on and off access points. We use Ward's machine learning hierarchical clustering technique to optimize the energy savings of our model in the network of the Unidades Tecnológicas de Santander (Bucaramanga, Colombia). We showed that energy savings of 21.5 kWh per day are possible. The success of the model in this context highlights its potential to achieve substantial energy savings.