因为Linux操作系统具有很高的稳定性,安全性,软件安装的便利性.已渐渐的被广大用户所接受并使用,下面就向大家讲解一下,如何配置Linux操作系统的防火墙呢?
修改防火墙配置需要修改 /etc/sysconfig/iptables 这个文件,如果要开放哪个端口,在里面添加一条。
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT就可以了,其中 1521 是要开放的端口号,然后重新启动linux的防火墙服务。
停止/启动防火墙服务的命令:
用root登录后,执行
service iptables stop --停止
service iptables start --启动
(service命令位于/sbin)
防火墙规则只有在 iptables 服务运行的时候才能被激活。要手工启动服务,使用以下命令:
/sbin rvice iptables restart
要确保它在系统引导时启动,使用以下命令:
/sbin/chkconfig --level 345 iptables on
ipchains 服务不能和 iptables 服务同时运行。要确定 ipchains 服务
被禁用,执行以下命令:
/sbin/chkconfig --level 345 ipchains off
这样,防火墙就全部设置好了
Copyright © 2013-2020. All Rights Reserved. 恒讯科技 深圳市恒讯科技有限公司 粤ICP备20052954号 移动站