25 Useful IPtable Firewall Rules Every Linux Administrator Should Know

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Marin Todorov

I am a bachelor in computer science and a Linux Foundation Certified System Administrator. Currently working as a Senior Technical support in the hosting industry. In my free time I like testing new software and inline skating.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

23 Responses

  1. zamil says:

    thanks for such a great information

  2. barath says:

    whois command is not working

    • Ravi Saive says:


      It doesn’t come pre-installed, you need to install whois command using following commands.

      On Ubuntu and Debian

      $ sudo apt-get install python-software-properties
      $ sudo add-apt-repository ppa:nathan-renniewaldock/ppa
      $ sudo apt-get update
      $ sudo apt-get install whois

      On CentOS and Fedora

      # yum install whois
  3. It's_k says:

    I am getting this error, it was running fine but suddenly it is giving this error and quits. I think it is may be due to some problem in the iptables

    sh: 1: ipchains: not found
    FATAL: Can't insert firewall redirects

    I’ve tried to re-installing everything but problem still persists. Please help

  4. shetu says:

    How to forward UDP 5060 port vps centos openvpn server to vpn client pc?

  5. Mickel says:

    I am using ivacy vpn. It offers NAT firewall feature to maximize the security.

  6. mmj says:

    Your sample rule to “block incoming ping” actually blocks all ICMP packets. Ping is only one of the many things ICMP can do; the rest include important functions like knowing when you need to fragment packets because they are too big or knowing when you are sending packets too fast.

    Blocking ICMP can make network connectivity less reliable and more prone to unexplained delays in general. You *can* block only certain ICMP functions, like ping, but ping isn’t a huge security risk anyway, nor are any other ICMP functions (except redirect, but even that doesn’t threaten any modern system).

  7. Me says:

    If you want to block the server from certain countries, you can download the free IP address list from https://www.ip2location.com/free/visitor-blocker

Leave a Reply to zamil Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.