Flushing iptables broke my pipe, how can I save my instance?

Niels asked:

I was setting up my iptables when I performed a iptables -F and my ssh pipe broke.

This is the last output of my session:

root@alfapaints:~# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere             state NEW,ESTABLISHED tcp dpt:2222
ACCEPT     tcp  --  li465-68.members.linode.com  anywhere             state NEW,ESTABLISHED tcp dpt:nrpe
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:9200 state NEW,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http state NEW,ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere             udp spt:domain

Chain FORWARD (policy DROP)
target     prot opt source               destination             

Chain OUTPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere             state ESTABLISHED tcp spt:2222
ACCEPT     tcp  --  anywhere             anywhere             state ESTABLISHED tcp spt:nrpe
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:9200 state ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:http state ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
root@alfapaints:~# iptables -F
Write failed: Broken pipe

I tested my connection just before and I was able to connect with ssh.
Now I did a nmap scan and not a single port is open anymore.
I know my VPS is running on VMWare ESXi, could a reboot help?

Or if not could I attach and mount the disk to another vm to save the data?

Does anybody have some advise?
And maybe an explanation what happend or what could have cause my pipe to break?

ps: I didn’t save my rules on the config directories of iptables.
But used a file I stored in ~/rules.config to apply my rules like this: iptables-restore < rules.config
So probably a reboot would help?

Thanks a lot in advance.

My answer:


You appear to be using Linode. In this case, use the Linode Shell to gain access to the console of your virtual machine. You can then login and repair your firewall.

Using some other provider, the provider can give you equivalent virtual console access. VMware is perfectly capable of this, for instance.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.