Linux 防火墙配置
来源:互联网 发布:淘宝图片保护怎么破解 编辑:程序博客网 时间:2024/05/19 23:28
Linux查看防火墙状态
存在以下两种方式:
一、service方式
查看防火墙状态:
[root@centos6 ~]# service iptables status
iptables:未运行防火墙。
开启防火墙:
[root@centos6 ~]# service iptables start
关闭防火墙:
[root@centos6 ~]# service iptables stop
二、iptables方式
先进入init.d目录,命令如下:
[root@centos6 ~]# cd /etc/init.d/
[root@centos6 init.d]#
然后
查看防火墙状态:
[root@centos6 init.d]# /etc/init.d/iptables status
暂时关闭防火墙:
[root@centos6 init.d]# /etc/init.d/iptables stop
重启iptables:
[root@centos6 init.d]# /etc/init.d/iptables restart
Linux配置防火墙
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
阅读全文
0 0
- linux防火墙配置
- Linux 防火墙配置
- Linux 防火墙配置
- Linux防火墙配置
- Linux防火墙配置
- Linux防火墙配置
- linux修改防火墙配置
- Linux 防火墙的配置
- Linux防火墙的配置
- [Linux] 防火墙配置
- Linux的防火墙配置
- Linux Centos 配置防火墙
- linux 防火墙配置规则
- SuSE Linux防火墙配置
- linux 修改防火墙配置
- LINUX配置防火墙
- Linux 防火墙配置
- Linux防火墙配置
- 数组反转
- 轻松理解MySql MVCC 实现机制
- mybatis xml
- 习题7-7 埃及分数(Eg[y]ptian Fractions (HARD version), Rujia Liu's Present 6, UVa 12558)
- css中position元素
- Linux 防火墙配置
- blender里不认识的单词(2)
- caffe源码阅读遇到的问题
- 一个页面上有大量的图片(大型电商网站),加载很慢,你有哪些方法优化这些图片的加载,给用户更好的体验。
- 可以使用USB2.0接口进行全双工通讯么,双方都可以主动发送么?
- JQuery_基础
- JAVA知识点概述
- 371. Sum of Two Integers
- 矩阵乘以它的转置