SUMMARYEnergy efficiency is an important desirable property for optical networks and a key parameter for the sustainability of the future Internet. In this work, we consider the energy-minimized design problem for IP over flexible optical networks. We provide an energy-aware multilayer network-planning algorithm, which takes as input the network topology, the IP end-to-end traffic matrix, the modular model of the IP/MPLS routers, and the feasible configurations of the flexible optical transponders. The algorithm serves the demands for their requested rates by placing router modules, selecting the paths in the IP topology, and the corresponding paths and spectrum slots in the underlying optical topology, together with the flexible optical transponders' transmission configurations. The algorithm's objective is to minimize the network's energy consumption, jointly accounting for the energy consumption of the routers' modules installed, the transponders used, and their configurations. Using realistic energy consumption and network traffic models, we evaluate the energy savings obtained when the proposed algorithm is applied to a flexible network, as opposed to a mixed-line-rate wavelength division multiplexing optical network. Moreover, we consider two optimization scenarios, comparing the joint energy consumption optimization of IP and optical layers to a sequential optimization of the energy consumed at these two layers.