CentOS 7 firewall-cmd 端口转发

CentOS官方推荐使用firewall-cmd实现端口转发,虽然它支持iptables,但是同一系统同时只能用firewall-cmd与iptables其中一个。在CentOS 7 v7.4.1708上的实验发现,在安装了firewall-cmd的情况下iptables命令都可用,运行它们的命令都能成功,但是不起到实际的作用。下面是一个firewall-cmd端口转发示例:

把端口为8001到9000之间的所有请求转给80端口:

firewall-cmd --permanent --zone=public --add-forward-port=port=8001-8999:proto=tcp:toport=80
firewall-cmd --reload

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native