Basic iptables Usage & Commands

Iptables is a program that allows you to configure Linux's built-in firewall. By default, no rules are set, meaning the firewall will accept all connections. This guide covers the basics of working with iptables. To execute any of the below commands, you will need to be logged in to your VPS via SSH.

To list all current iptables rules:

# iptables -L

To flush/clear all current firewall rules:

# iptables -F

 

To stop/disable iptables temporarily:

# service iptables save

# service iptables stop

 

To restart the iptables service:

# service iptables restart

or

# /etc/rc.d/init.d/iptables restart

(Usage: /etc/rc.d/init.d/iptables start|stop|restart|condrestart|status|panic|save)

  • payment
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What happens when a VPS reaches its bandwidth limit?

If your VPS exceeds its bandwidth limit, our system will automatically suspend the service. You...

OpenVZ or Xen VPS - Which is faster, and which is better?

The question is often asked whether OpenVZ or Xen, two of the most common hypervisors in VPS web...

How to Check CPU Info with SSH on Linux VPS

To check the CPU allocation and information on your VPS, simply log in to SSH as root, and run...

Do I need a VPS? (Shared vs. VPS Hosting)

We often hear the question, "do I need a VPS?" Whether you are looking to upgrade from Shared...

General Linux Shell Usage & Basic Commands

Below is a brief guide for basic usage of a Linux shell (command line). Once you've mastered the...