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.