Centos firewall initialization setting method

Source: Internet
Author: User
Step 2: log on to the centos system using ssh or the root user with the highest privilege on the local machine, run & ldquo; iptables-F & rdquo; and confirm. After the command is confirmed, no success prompt is displayed. Step 2: run the & ldquo; serviceiptablessave & rdquo; command again and confirm. When & ldquo;

Step 2: log on to the centos system by using ssh or directly using the root user with the highest permissions on the local machine, run "iptables-F", and confirm.

After the command is confirmed, no success prompt is displayed.

Step 2: run the "service iptables save" command again and confirm the operation. if the message "iptables: Saving firewall rules to/etc/sysconfig/iptables: [OK]" is displayed, the operation is successful.

This step is to run the iptables-F command in the first step of this article, but the command is successfully executed, but it has not yet taken effect, so we need to restart the firewall.

Step 2: run the "service iptables restart" command and make sure that the firewall is initialized and restarted when four OK messages are displayed.

Run the "/etc/init. d/iptables status" command to view information about the current centos firewall. after initialization, there are only two or three firewall rules by default.

 

Step 2: to modify the port, use vi to edit the firewall configuration file "vi/etc/sysconfig/iptables,

Enter the port to be opened and run the Restart command again!

Related Article

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.