Linux open firewall, turn off the firewall to allow the port to remove the port

linux use more than 7

systemctl status firewalld check the status of
systemctl enable firewalld permanent firewall is enabled
after systemctl stop firewalld stop firewall restart failure
systemctl disable firewalld disable the firewall permanently
systemctl start firewalld start

systemctl restart firewalld restart 
view port netstat open -anp
add ports allow firewall-cmd --add-port = 8080 / tcp --permanent
if removal port firewall-cmd --permanent --remove-port = 8080 / tcp

Policy changes are complete, please reboot: systemctl restart firewalld

 
The following use linux 7


Status iptables-Service
-Service iptables Start
-Service iptables STOP
-Service iptables the restart
 
firewall port configuration rules permit to obtain the port / etc / sysconfig / iptables

-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEP
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEP

Policy changes are complete, please restart: service iptables restart

Published 12 original articles · won praise 0 · Views 646

Guess you like

Origin blog.csdn.net/oopxiajun2011/article/details/105098979