iptables禁止别人,允许自己时间:2023-03-10 06:18:21 这里举个例子,以ping为案例:禁止别人ping自己,但允许自己ping别人。 [root@localhost ~]# iptables -A INPUT -p icmp --icmp-type 8 -d 192.168.0.130 -j DROP [root@localhost ~]# iptables -A OUTPUT -p icmp --icmp-type 0 -s localip -j ACCEPT 基本上设置第一条就ok了,主要是-d ,目标ip。