As I'm learning about iptables I've made a couple of mistakes and locked myself out.
What method(s) do you use to test rules without locking yourself out?
I'm using ubuntu server 12.04 LTS
All the answers below were helpful. In the end I used a combination of options. It also helps to have IPMI access to your remote server just in case! But ideally test the rules locally on a replicated environment and test that first. Vagrant helps in this regard to get test setups working quickly.