加黑名单(单IP)
iptables -A INPUT -s x.x.x.x -j DROP
加黑名单(段IP)
iptables -A INPUT -s x.x.x.x/xx -j DROP
--------------------------------------------------------------分割线--------------------------------------------------------
加白名单(单IP)
iptables -A INPUT -s x.x.x.x -j ACCEPT
加白名单(段IP)
iptables -A INPUT -s x.x.x.x/xx -j ACCEPT
博客介绍了在Linux服务器上使用iptables命令设置黑白名单的方法。包括添加单IP和段IP的黑名单,使用“iptables -A INPUT -s x.x.x.x -j DROP”和“iptables -A INPUT -s x.x.x.x/xx -j DROP”;添加单IP和段IP的白名单,使用“iptables -A INPUT -s x.x.x.x -j ACCEPT”和“iptables -A INPUT -s x.x.x.x/xx -j ACCEPT”。
1386

被折叠的 条评论
为什么被折叠?



