I'm trying to setup iptables to cause realistic network failures between docker containers. On the server, I run both netcat -lk 1234
and an Erlang cowboy server. On the client I run clients:
echo blah | netcat myserver 1234
curl myserver/xyz
Initially, these work ok, there's evidence of client-server communications. Next, I introduce iptables DROP rule on client's OUTPUT.
iptables -A OUTPUT -j DROP
echo blah | netcat myserver 1234
curl myserver/xyz
Both netcat and curl communications don't get through, until I remove the DROP rule, at which point they recover seamlessly!
Finally I repeat the above, but before the remove the DROP rule, I ctrl-c the client executables. Upon removing the DROP rule, I observe no evience of server receiving client's requests.
My conclusion is that the netat/curl client must be attempting to re-transmit indefinitely? Shouldn't I eventually expect a failure? Btw, same thing happens when with other clients, eg. Erlang http/websocket_client.