CentOS 6.2防火墙简单使用

字体大小: 中小 标准 ->行高大小: 标准

自动启用CentOS 6.2防火墙:

chkconfig –level 2345 iptables on

关闭防火墙:

/etc/init.d/iptables stop

查看防火墙信息:

/etc/init.d/iptables status

添加一条防火墙规则:

/sbin/iptables -I INPUT -p tcp –dport 8080 -j ACCEPT #8080为指定端口

保存防火墙规则:

/etc/rc.d/init.d/iptables save #将更改进行保存

重启防火墙:

/etc/init.d/iptables restart #重启防火墙以便改动生效,当然如果不觉得麻烦也可重启系统(命令:reboot)

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/65141.html