The Linux networking stack is the Swiss Army Knife of the tech world.
Using iptables, drop a random 10% of incoming and outgoing packets:
iptables -A INPUT -m statistic --mode random --probability 0.1 -j DROP
iptables -A OUTPUT -m statistic --mode random --probability 0.1 -j DROP
To reset: