Question

Firewall appears in place, but no iptables rules found

  • Posted June 30, 2013

According to nmap, my droplet has ports 22,25,80,554 and 7070 open, the rest are closed.

But when I run iptables, there are no rules defined (see below).

How do I configure the firewall rules for my droplet?

Thanks for any assistance.

root@devi2:~# for t in filter mangle nat raw ; do iptables -t $t -vnL ; done Chain INPUT (policy ACCEPT 73691 packets, 3651K bytes) pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 74211 packets, 3903K bytes) pkts bytes target prot opt in out source destination
Chain PREROUTING (policy ACCEPT 152 packets, 11500 bytes) pkts bytes target prot opt in out source destination

Chain INPUT (policy ACCEPT 152 packets, 11500 bytes) pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 149 packets, 24128 bytes) pkts bytes target prot opt in out source destination

Chain POSTROUTING (policy ACCEPT 149 packets, 24128 bytes) pkts bytes target prot opt in out source destination
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination

Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 1 packets, 652 bytes) pkts bytes target prot opt in out source destination

Chain POSTROUTING (policy ACCEPT 1 packets, 652 bytes) pkts bytes target prot opt in out source destination
Chain PREROUTING (policy ACCEPT 152 packets, 11500 bytes) pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 147 packets, 22680 bytes) pkts bytes target prot opt in out source destination

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Check out <a href=“https://www.digitalocean.com/community/articles/how-to-set-up-a-firewall-using-ip-tables-on-ubuntu-12-04”>How to Set Up a Firewall Using IP Tables on Ubuntu 12.04</a>

We do not block any ports by default. I believe the reason why nmap shows only the ports you mentioned is because there isn’t anything listening on the other ports so they appear as closed.