I typically use dummynet in FreeBSD (picoBSD, really) on a floppy or bootable USB token (or in a Virtual Machine) to do this. But you can also do it with iptables in Linux, some configurable switches, and specialty devices like this one or other WAN/LAN emulators.