Enable iptables firewall in CentOS 7

Source: Internet
Author: User

Enable iptables firewall in CentOS 7

In the latestIn CentOS 7 linux, the default firewall is changed to firewalld, replacing the previous iptables firewall. How can I enable the iptrables firewall again? This article will show you how to delete existingFirewalld firewall? How to installIptables Firewall:

Disable firewalld firewall in CentOS 7

First, stop the firewalld service and enter the following command:

1

$ Sudo systemctl stop firewalld. service

Disable the firewalld service from automatically starting when the system starts. Enter the following command:

1

$ Sudo systemctl disable firewalld. server

If you will not use the firewalld service in the future, you can directly uninstall it and use the following command:

1

$ Sudo yum remove firewalld-y

Install iptables firewall in CentOS 7

To install the iptables package, run the following command:

1

$ Sudo yum install iptables-services

Set the iptables Firewall Service to automatically start when it starts up. Enter the following command:

1

$ Sudo systemctl enable iptables

If you want to use/etc/init. d/iptables save command to save the modified firewall policy. Enter the following command to save iptables. the init script overwrites the script after iptables is installed. Enter the following command:

1

$ Sudo/usr/libexec/iptables. init/etc/init. d/iptables

In this case, you can run the/etc/init. d/iptables save command.

1

$ Sudo/etc/init. d/iptables save


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.