linuxnetwork-programmingpacketpacket-loss

Dropping Packets Intentionally


I want to test robustness of my application. So i want a linux command that will drop few packets for some nanosecond. I am receiving these packets from a multicast IP-Port.


Solution

  • I found this and it worked
    iptables -A INPUT -m statistic --mode random --probability 0.01 -j DROP

    To undo this command
    iptables -D INPUT -m statistic --mode random --probability 0.01 -j DROP