Two important problems arise in WDM network planning: network design to minimize the operation cost and traffic grooming to maximize the usage of the high capacity channels. In practice, however, these two problems are usually simultaneously tackled, denoted as the network design problem with traffic grooming (NDG). In this paper, a mathematical formulation of the NDG problem is first presented. Then, this paper proposes a new metaheuristic algorithm based on two-level iterated local search (TL-ILS) to solve the NDG problem, where a novel tree search based neighborhood construction and a fast evaluation method are proposed, which not only enhance the algorithm's search efficiency but also provide a new perspective in designing neighborhoods for problems with graph structures. Our algorithm is tested on a set of benchmarks generated according to real application scenarios. We also propose a strengthening formulation of the original problem and a method to obtain the lower bound of the NDG problem. Computational results in comparison with the commercial software CPLEX and the lower bounds show the effectiveness of the proposed algorithm.