I am running several software components communicating with each other through different ports on a single machine. one of them is a kernel module. I want to simulate network disconnections between them. can I use firewalld with rich rules to drop packets that come from one port and designated to another?
I have tried
$ sudo firewall-cmd --add-rich-rule='rule family=ipv4 source-port port=50778 protocol=tcp drop'
which works, but blocks one component from all others and I only want to simulate on-to-one disconnection. if I add any other port field in this line I get an error.
can I do that using firewalld? or should I use iptables or others instead?