Linux (CENTOS7) firewall command __linux

Source: Internet
Author: User

Firewall Configuration

CentOS 7 uses firewall as a firewall by default, and this is iptables firewall instead.


Firewall Action:

# service FIREWALLD status; #查看防火墙状态


(disabled indicates that the start enable enabled is disabled and inactive indicates that the firewall shutdown status activated (running) is indicated as open)

# service FIREWALLD start; or #systemctl start firewalld.service; #开启防火墙

# service FIREWALLD stop; or #systemctl stop Firewalld.service; #关闭防火墙

# service FIREWALLD Restart;  or #systemctl restart Firewalld.service; #重启防火墙

# systemctl Disable firewalld.service# prevent firewall from starting

# Systemctl Enable firewalld# set firewall boot

#yum Remove firewalld# Uninstall firewall


Install iptables Firewalls and operations:

Install iptables firewall #yum install iptables-services#

#vi/etc/sysconfig/iptables# Edit firewall configuration file, open 3306 Port add configuration:-A input-p tcp-m State--state new-m TCP--dport 3306-j ACCEPT

#systemctl Restart Iptables.service #最后重启防火墙使配置生效

#systemctl Enable Iptables.service #设置防火墙开机启动

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.