安裝了個centos 6.6 默認的防火牆爲:centos
service iptables statustcp
打開80端口:.net
iptables -I INPUT -p tcp --dport 80 -j ACCEPTip
以後保存: service iptables saveget
[root@localhost conf]# service iptables savetable
iptables: Saving firewall rules to /etc/sysconfig/iptables: [ OK ]iptables
下面這句是把80的轉到8080?service
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080 防火牆