iptables 配置文件内容如下:
#1、允许22和80端口允许外部访问
#2、允许本地调用任何端口
#3、允许数据响应
#4、允许本地访问外部资源
# Generated by iptables-save v1.4.7 on Fri Apr 21 17:05:53 2023
*filter :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A OUTPUT -j ACCEPT COMMIT # Completed on Fri Apr 21 17:05:53 2023