Isolating and Parititioning (`iptables`)
Last updated
Last updated
You can use iptables
to simulate things like network partitions or isolation. It works great along with tc
for creating hazardous network situations.
You can also use iptables to do some simulations of link related failure, for example, to drop 10% of all incoming packets. You can use whichever you prefer.
Be careful, you could accidentally lock yourself out if you're over SSH!
iptables
works on the concept of "chains". As a packet travels through your system it will be processed by these chains in a given order. The has a great diagram:
You can remove the -s 8.8.8.8
or -dport 25
to have the rule apply more generally.
Try to avoid going over 15% packet loss, TCP starts to seriously degrade at that point.
Check the DNS provider of eth0
(with systemd-resolve --status
) Try preventing outgoing DNS requests (UDP port 25), does nslookup
work with Github.com? What about if you only block one of the DNS servers?
Isolate a client (such as psql
) from communicating with a server. Too easy? Try isolating a master from a replica.
Use tc
and iptables
both to introduce packet loss, which is easier?