Some common configurations of firewalls in CentOS7

Source: Internet
Author: User

# start Systemctl start firewalld# View status Systemctl state firewalld# stop close systemctl disable firewalldsystemctl stop firewalld# put A source address is whitelisted to allow all connections from this source address # This uses the common # setting in the cluster after using Firewall-cmd--Reload Update firewall rules Firewall-cmd--add-rich-rule‘Rule family= "IPv4" source address= "192.168.1.215" accept‘ --Permanentfirewall-cmd--reload# users within a specific domain can connect via SSH, 24 identifies 255.255.255.0Firewall-cmd--remove-service=SSH--Permanentfirewall-cmd--add-rich-rule‘Rule Family=ipv4 Source Address=172.16.30.0/24 accept‘ --Permanentfirewall-cmd--Reloadfirewall-cmd--list-All # Add a user to whitelist Firewall-cmd--add-lockdown-whitelist-user=hadoop--Permanentfirewall-cmd--reload# remove the user ID from the whitelist firewall-cmd--remove-lockdown-whitelist-uid=uidfirewall-cmd--reload# View all open ports: firewall-cmd--list-ports# Open port Firewall-cmd--zone=public--add-port=8080/tcp-- permanent# close port firewall-cmd--remove-port=465/TCP # Open the service, see/etc/firewalld directory, You can configure Firewall-cmd--permanent--zone=public--add-service=sambafirewall-cmd-- Add-service=http--permanent firewall-cmd--reload# Close service Firewall-cmd--zone=public--remove-service=sambafirewall-cmd--reload   

Official documents and common references:

Https://access.redhat.com/documentation/zh-CN/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html

Https://www.server-world.info/en/note?os=CentOS_7&p=firewalld

Some common configurations of firewalls in CentOS7

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.