I would like to test the behavior of components of my system over time if certain TCP packets are dropped, to simulate network problems. I'd like to systematically recreate issues where a connection is established, but then one side stops responding. I am new to using IP Tables, and having a hard time finding syntax for an issue I am trying to re-create.
Is there a way to create an IP Tables rule to always drop the (for example) 10th packet received on any connection from a particular IP? Or to always drop all packets received after the 10th packet from a given IP on that connection?
I am not wanting to drop 10% of packets at random, but rather to just drop a particular packet number in the connection, or to drop all packets after a certain number have been received.