Forced packet loss

For testing purposes, to determine how the protocol implementation works in the presence of packet loss, I would like to force packet loss on one of my network devices. In particular, I would like to be able to configure packet loss somewhere between 0% and 100%. I have little experience with iptables, and it seems to me that I can achieve this with this, but I could not. Achieving 100% packet loss is not a problem, though;). Any ideas on how to do this?

+4
source share
1 answer

Browse the iptables' statistics module.

I think something like

iptables -A FORWARD -m statistic --mode random --probability 0.5 -j DROP 

should do the trick on the router.

+4
source

Source: https://habr.com/ru/post/1400374/


All Articles