Network testbeds are very popular tools for research on network protocols and distributed applications. To reproduce network behavior, testbeds range between two extremes: use a fully emulated network, or distribute nodes on the real Internet. The former approach yields very reproducible results but might be a poor representation of reality; the latter gives more realistic but less reproducible scenarios. In this paper we present an emulation solution for the Planet Lab testbed, and provide a detailed description of its features and performance. Our system gives researchers the advantages of emulation while not giving up the opportunity of running experiments in a large and heterogeneous testbed with realistic network conditions. The work is based on a Linux version of the Dummynet network emulator, largely extended with specific features to improve efficiency on Planet Lab, and to emulate wireless links with custom configuration mechanisms to simplify its use. The system described in this paper, developed as part of the Onelab2 project, has been deployed on the whole Planet Lab-Europe testbed. The emulation code itself is also available for all popular operating systems (FreeBSD, Linux, Windows, OS X).