Common iptables template Configuration

Source: Internet
Author: User
#! /Bin/bash # Clear the original firewall rules iptables-F # Save the firewall configuration service iptables save # Stop the Firewall Service iptables stop # Open the SSH firewall iptables-A input-p tcp -- dport 22- j accept # Open Database firewall rules iptables-A input-s 192.168.3.0/24-p tcp -- dport 3306-J accept # Open firewall rules iptables-A input-M state -- state related, established-J accept # Open Ping firewall rule iptables-A input-p icmp-J accept # the default rule for firewall incoming is dropiptables-P input drop # the default rule for firewall outgoing traffic is dropiptables-P ouput. accept # Save the firewall configuration service iptables save # restart the Firewall Service iptables restart

Note: The port to be opened to the local machine can be added to the script content in the open port 22 format. After the script is successfully added, execute the script.

This article from the "Chengdu @ A like" blog, please be sure to keep this source http://azhuang.blog.51cto.com/9176790/1440167

Common iptables template Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.