> Basically I want an API where I can torture an EC2 instance to see what happens to it, for science!
# cat > dropme.sh <<'EOFILE'
#!/bin/sh
set -eu
read -r SLEEP
tmp=`mktemp` ; tmp6=`mktemp`
iptables-save > $tmp
ip6tables-save > $tmp6
for t in iptables ip6tables ; do
for c in INPUT OUTPUT FORWARD ; do $t -P $c DROP ; done
$t -t nat -F ; $t -t mangle -F ; $t -F ; $t -X
done
sleep "$SLEEP"
iptables-restore < $tmp
ip6tables-restore < $tmp6
rm -f $tmp $tmp6
EOFILE
# chmod 755 dropme.sh
# ncat -k -l -c ./dropme.sh $(ifconfig eth0 | grep 'inet ' | awk '{print $2}') 12345 &
# echo "60" | ncat -v $(ifconfig eth0 | grep 'inet ' | awk '{print $2}') 12345
If you're lucky the existing connections won't even die, but the box will be offline for 60 seconds.