iptables:
封1.1.1.1
iptables -I INPUT -s 1.1.1.1 -j DROP
解封
iptables -D INPUT -s 1.1.1.1 -j DROP
保存重启防火墙
service iptables save
service iptables restart
firewalld:
封
firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address="1.1.1.1" drop'
解封
firewall-cmd --permanent --remove-rich-rule='rule family=ipv4 source address="1.1.1.1" drop'
保存重启防火墙
firewall-cmd --reload
无firewalld命令,安装下服务
yum -y install firewall-config