赞
踩
systemctl start firewalld.service
systemctl stop firewalld.service
systemctl status firewalld.service
systemctl enable firewalld.service
systemctl disable firewalld.service
firewall-cmd --zone=public --add-port=80/tcp --permanent //永久
firewall-cmd --zone=public --add-port=80/tcp //临时
firewall-cmd --zone=public --add-masquerade --permanent //打开IP地址伪装
//将8080转发到80
firewall-cmd --zone=public --add-forward-port=port=80:proto=tcp:toport=8080 --permanent
//创建blacklist ipset
firewall-cmd --permanent --zone=public --new-ipset=blacklist --type=hash:ip
//封禁 blacklist
firewall-cmd --permanent --zone=public --add-rich-rule='rule source ipset=blacklist drop'
//查看 blacklist
firewall-cmd --ipset=blacklist --get-entries
//添加IP到黑名单
firewall-cmd --permanent --zone=public --ipset=blacklist --add-entry=212.237.51.36
firewall-cmd --permanent --zone=public --ipset=blacklist --add-entry=188.226.191.66
firewall-cmd --permanent --zone=public --ipset=blacklist --add-entry=80.211.137.182
firewall-cmd --permanent --zone=public --ipset=blacklist --add-entry=60.191.66.226
firewall-cmd --permanent --zone=public --add-rich-rule='rule protocol value=icmp drop'
firewall-cmd --reload
参考文章
云服务器 ECS CentOS 7配置默认防火墙 Firewall
https://help.aliyun.com/knowledge_detail/41317.html
RHEL7、CentOS7 下使用 Firewall 封IP
https://www.itlnmp.com/401.html
firewalld禁止被PING(丢弃ICMP包)
http://blog.csdn.net/Sidyhe/article/details/54836165?locationNum=10&fps=1
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。