Forcing packet loss

邮差的信 提交于 2020-01-02 05:46:14

问题


For testing purposes, to determine how a protocol implementation behaves in the presence of packet loss, I would like to force packet loss on one of my network devices. Specifically, I would like to be able to tune the packet loss anywhere between 0% and 100%. I have a little experience with iptables and it seems to me I should be able to achieve it using that, but I haven't been able to. Achieving 100% packet loss is not a problem though ;). Any ideas on how to do this?


回答1:


Look into iptables' statistic module.

I guess something like

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

should do the trick on a router.



来源:https://stackoverflow.com/questions/9617148/forcing-packet-loss

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!