WANsim allows you to simulate (more accurately, emulate) a WAN connection. In particular, it allows a user to change the emulated WAN speed, latency, variation, packet loss, packet duplication and packet corruption aspects. WANsim is usually configured as a network bridge that is established between two NICs at boot time.
WANsim utilises the Linux Kernel NETEM functionality to accomplish its goals. Although relatively well documented, this functionality is not the easiest to use. WANsim wraps this into a simple to use script that can be accessed by simply logging into the Linux host using the wansim user account.