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
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
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>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.