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
這篇文章有幫助嗎?

相關文章

How to close an open DNS resolver - Linux

Locate the BIND configuration file within the operating system. The BIND configuration file is...

How to Optimize MySQL with MySQLTuner

MySQLTuner is a script that will assess MySQL performance and recommend steps to maximize...

How to Modify SSH to Use a Port Other than 22

  A simple, but very effective, step you can take to enhance your server's security is to update...

How to List All Open/Listening Ports

If you find yourself needing to check all open/listening ports that your server is using (a good...

How to Install ConfigServer Firewall (CSF)

ConfigServer Firewall, or CSF, is a common Linux security suite. Log in to your VPS as the root...

Powered by WHMCompleteSolution