Steps for setting up firewall whitelist (RHEL 6 and CentOS 7) under Linux _linux

Source: Internet
Author: User
Tags iptables


How to open firewall in centos 7
Go to the Linux command line and edit the firewall rule profile iptables
Vi/etc/sysconfig/iptables


Centos 7 firewall commands


Below is an example of a whitelist setting: how to check firewall rules in centos 7

Centos 7 firewall cmd

# Firewall configuration written by System-config-securitylevel # Manual customization of ' This ' file is ' not recommended. *filter:input ACCEPT [0:0]: FORWARD ACCEPT [0:0]: OUTPUT ACCEPT [0:0]: Rh-firewall-1-input-[0:0]-N whitelist-a White List-s 10.202.106.1-j accept-a whitelist-s 10.202.106.2-j accept-a whitelist-s 10.202.106.3-j accept-a Whitelist -S 10.202.106.4-j accept-a whitelist-s 10.202.106.5-j accept-a whitelist-s 10.202.106.6-j accept-a whitelist-s 10 .202.106.7-j accept-a input-j rh-firewall-1-input-a forward-j rh-firewall-1-input-a rh-firewall-1-input-i lo-j AC Cept-a rh-firewall-1-input-p ICMP--icmp-type any-j accept-a rh-firewall-1-input-p 50-j accept-a RH-Firewall-1-INPU  T-p 51-j accept-a rh-firewall-1-input-p UDP--dport 5353-d 224.0.0.251-j accept-a rh-firewall-1-input-p UDP --dport 631-j accept-a rh-firewall-1-input-p tcp-m tcp--dport 631-j accept-a rh-firewall-1-input-m State--state Established,related-j ACCept-a rh-firewall-1-input-m State--state new-m tcp-p TCP--dport 22-j accept-a rh-firewall-1-input-m State--stat E new-m tcp-p tcp--dport 4750-j accept-a rh-firewall-1-input-m State--state new-m tcp-p TCP--dport 3306-j List-a rh-firewall-1-input-j REJECT--reject-with icmp-host-prohibited COMMIT
Enable port firewall centos 7
The part of the white list is set:turn on firewall centos 7



-N Whitelist
-a whitelist-s 10.202.106.1-j ACCEPT
-a whitelist-s 10.202.106.2-j ACCEPT
-a whitelist-s 10.  202.106.3-j ACCEPT
-a whitelist-s 10.202.106.4-j ACCEPT-a
whitelist-s 10.202.106.5-j ACCEPT
-a whitelist -S 10.202.106.6-j ACCEPT
-A whitelist-s 10.202.106.7-j ACCEPT


Use the White list rule to specify using the J parameter:



-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 3306-j Whitelist


The above Linux set Firewall white list (RHEL 6 and CentOS 7) is the step of the small series to share all the content, I hope to give you a reference, but also hope that we support the cloud habitat community.

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.