Create a file /root/fw.stop with the following content:
#!/bin/sh echo "Stopping firewall and allowing everyone..." iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT
Make it executable and then run it on the terminal.
Source: http://www.cyberciti.biz/tips/linux-iptables-how-to-flush-all-rules.html