Why don't you use a local access ?
Maybe an iptables -F would help. This command should erase every rule in iptables. If you are experiencing problems later you should try to reboot for iptables to generate a basic set of rules.
As I don't know exactly what you did, I can't submit you another solution. Maybe you should just take the command you typed and modify it to make sure the ports are opened.