Linux防火墙限制访问服务器IP和端口
笔记
逐行执行命令
firewall-cmd --statesystemctl start firewalldsystemctl enable firewalldfirewall-cmd --get-default-zonefirewall-cmd --set-default-zone=trustedfirewall-cmd --permanent --new-zone=ssfirewall-cmd --permanent --zone=ss --add-source=IPfirewall-cmd --permanent --zone=ss --add-port=端口/tcpfirewall-cmd --permanent --zone=trusted --add-rich-rule="rule family=ipv4 port protocol=tcp port=端口 drop"firewall-cmd --reload
查看
firewall-cmd --get-active-zonefirewall-cmd --list-allfirewall-cmd --zone=ss --list-all
来源地址:https://blog.csdn.net/qq_39960204/article/details/130882282