Linux 防火墙开放特定端口 (iptables)

1、查看状态:iptables -L -n
2、直接编辑:vi /etc/sysconfig/iptables
3、端口开放:-A INPUT -m state --state NEW -m tcp -p tcp --dport 18080 -j ACCEPT
4、保存文件::wq
5、重启防火墙:service iptables restart
备注:批量开端口 -A INPUT -p tcp -m tcp --dport 18080:18090 -j ACCEPT

原文地址:https://www.cnblogs.com/fangts/p/8888188.html