1.iptables防火墙
systemctl start iptables //开启/暂停服务
systemctl stop iptables //
systemctl disable iptables //禁止/解除禁止 iptables 服务
systemctl enable iptables
service iptables status
systemctl enable iptabls.service
systemctl restart iptables.service
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3000 -j ACCEPT
systemctl start iptables.service
systemctl enable iptables
yum update iptables
yum update iptables-services
yum install -y iptables
yum install iptables-services
systemctl stop firewalld
systemctl mask firewalld
/sbin/iptables -I INPUT -p tcp --dport 5212 -j ACCEPT
/sbin/iptables -I OUTPUT -p tcp --dport 5212 -j ACCEPT
/etc/rc.d/init.d/iptables save
/etc/rc.d/init.d/iptables restart
/etc/init.d/iptables status
systemctl stop firewalld.service
2.firewalld防火墙管理
systemctl restart firewalld.service
systemctl start firewalld
systemctl stop firewalld
firewall-cmd --state
firewall-cmd --zone=public --add-port=5121/tcp --permanent
firewall-cmd --zone=public --remove-port=5121/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-ports