1、查看防火墙状态,哪些端口开放了
/etc/init.d/iptables status
2、配置防火墙
vi /etc/sysconfig/iptables ###################################### # firewall configuration written by system-config-firewall # manual customization of this file is not recommended. *filter :input accept [0:0] :forward accept [0:0] :output accept [0:0] -a input -m state –state established,related -j accept -a input -p icmp -j accept -a input -i lo -j accept -a input -m state –state new -m tcp -p tcp –dport 22 -j accept -a input -m state –state new -m tcp -p tcp –dport 80 -j accept -a input -m state –state new -m tcp -p tcp –dport 8080 -j accept -a input -j reject –reject-with icmp-host-prohibited -a forward -j reject –reject-with icmp-host-prohibited commit #####################################
#最后重启防火墙使配置生效
/etc/init.d/iptables restart