关闭或开启Linux上的防火墙
2015-09-05 01:15
375 查看
关闭
/etc/rc.d/init.d/iptables stop
开启
/etc/rc.d/init.d/iptables start
查看当前配置:iptables -L
伦理片 http://www.dotdy.com/
redhat :
chkconfig --level 2345 iptables off
service iptables stop
但是不推荐关闭防火墙
1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。
在开启了防火墙时,做如下设置,开启相关端口,
修改/etc/sysconfig/iptables 文件,添加以下内容:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
/etc/rc.d/init.d/iptables stop
开启
/etc/rc.d/init.d/iptables start
查看当前配置:iptables -L
伦理片 http://www.dotdy.com/
redhat :
chkconfig --level 2345 iptables off
service iptables stop
但是不推荐关闭防火墙
1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。
在开启了防火墙时,做如下设置,开启相关端口,
修改/etc/sysconfig/iptables 文件,添加以下内容:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
相关文章推荐
- linux下的硬盘检测工具 Smartmontools
- RedHat5.6、6.0使用CentOS yum源
- 临界区、互斥、信号量、事件区别
- linux中正则表达式简介
- yum错误
- Linux命令备忘实例(5)——切取命令
- Chapter4.1.1linux常用命令 文件处理ls ls
- Linux初级阶段常见配置文件大全
- Linux系统中RPS/RFS介绍
- 开源知识库管理系统选型 centos6.4 搭建knowlededgeroot-1.0.4知识库平台
- Linux命令汇总之正则表达式
- Linux下安装JDK
- get_optlong用法(linux解析命令行参数)
- Linux程序设计-读书笔记2
- Linux开机流程
- 如何查看linux系统是32位还是64位
- Linux下编程-----文件与IO(二)stat函数
- Linux下进程线程,Nignx与php-fpm的进程线程方式
- 分享《学习linux几点忠告》
- Understanding the Linux Kernel