iptables -I INPUT -p tcp --dport 8888 -j DROP
iptables -I INPUT -s 10.9.145.101 -p tcp --dport 8888 -j ACCEPT
service iptables save
参考文章:
https://www.cnblogs.com/jycjy/p/11003913.html#:~:text=Linux%E9%98%B2%E7%81%AB%E5%A2%99--iptables--%E7%99%BD%E5%90%8D%E5%8D%95%E9%85%8D%E7%BD%AE%201.%E6%9C%8D%E5%8A%A1%E5%99%A822%E7%AB%AF%E5%8F%A3%E5%92%8C1521%E7%AB%AF%E5%8F%A3%E5%BC%80%E9%80%9A%E7%BB%99%E6%8C%87%E5%AE%9AIP%202.%E6%B3%A8%E6%84%8F%EF%BC%9A%E6%AF%8F%E6%AC%A1%E6%9C%80%E5%90%8E%E9%9C%80%E8%A6%81%E6%B7%BB%E5%8A%A0%20iptables%20-I%20INPUT%20-i%20lo,INPUT%20-m%20state%20--state%20RELATED%2CESTABLISHED%20-j%20ACCEPT%203.%E6%8F%92%E5%85%A5%E5%88%B0%E9%82%A3%E4%B8%80%E8%A1%8C
标签:iptables,20,Centos,E5%,8F%,E6%,E7%,6.5 From: https://www.cnblogs.com/suyj/p/17022741.html