Basic iptables usage

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)

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Migrating/Restoring large cPanel domain from shared hosting account to your VPS server

cPanel facilitates you to restore full domain including email accounts, MySQL databases, database...

Basic Linux Commands

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

Installing CSF (ConfigServer Firewall) on a server

This guide will walk you through installing CSF on a VPS/Dedicated server. Preparing the server...

How to SSH into your VPS

After receiving your VPS login details, the first thing you'll want to do is log in to the VPS....

What happens when you reach your VPS bandwidth limit?

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