The energy consumption of information and communications technology networks is increasing rapidly as a result of the Internet expansion in reach and capacity. In this paper, we investigate energy-efficient physical topologies for backbone IP over wavelength-division multiplexing (WDM) networks. We develop a mixed integer linear programming model to optimize the physical topology of IP over WDM networks with the objective of minimizing the network total power consumption. We consider the National Science Foundation network topology and compare its energy consumption with the energy consumption of optimized physical topologies under different IP over WDM approaches and nodal degree constraints. We study the physical topology optimization under a symmetric full-mesh connectivity traffic matrix and an asymmetric traffic demand, where data centers create a hot node scenario in the network. We also investigate the power savings obtained by deploying topologies that eliminate the need for IP routers, including a full-mesh topology and a star topology. Simulation results show that the full-mesh and star topologies result in significant power savings of 95% and 92%, respectively. Furthermore, the optimization of the physical topology is investigated considering the presence of renewable energy sources in the network. The results show that optimizing the physical topology increases the utilization of the renewable energy sources.