Linux命令-添加防火墙

iptables -L #查看已有的防火墙规则链
iptables -F #清空已有的防火墙规则链
iptables -D INPUT 1 #删除INPUT规则链中第一条规则

栗子

iptables -I INPUT -p tcp --dport 8897 -s 10.187.161.14 -j DROP
ip c端 port p端

表示端口号为8897的应用对所有来自IP地址为14的请求进行拦截

猜你喜欢

转载自www.cnblogs.com/suger43894/p/12156344.html