centos 6

关闭命令:  service iptables stop 
永久关闭防火墙:chkconfig iptables off

两个命令同时运行,运行完成后查看防火墙关闭状态 
        service iptables status

CentOS7 的防火墙配置跟以前版本有很大区别,经过大量尝试,终于找到解决问题的关键

CentOS7这个版本的防火墙默认使用的是firewall,与之前的版本使用iptables不一样。按如下方便配置防火墙:

1、关闭防火墙:sudo systemctl stop firewalld.service

2、关闭开机启动:sudo systemctl disable firewalld.service

3、安装iptables防火墙

执行以下命令安装iptables防火墙:sudo yum install iptables-services

?

4、配置iptables防火墙,打开指定端口(具体跟以前版本一样,网上介绍很多,这里不多介绍了)

5. 设置iptables防火墙开机启动:sudo systemctl enable iptables

?

OK了,根据配置的端口就可以访问了

 

centos 6和centos7关闭防火墙的方法的更多相关文章

  1. redhat linux/CentOS 6/7 如何关闭防火墙?

    redhat linux/CentOS 6/7 如何关闭防火墙?关闭防火墙iptables的具体命令如下: 临时性的完全关闭防火墙,可以不重启机器(但是重启服务器后iptables防火墙服务会自动随系 ...

  2. centos7 关闭防火墙

    centos7 关闭防火墙 1.firewall相关的操作    查看防火墙状态 firewall-cmd    --state 关闭防火墙 systemctl  stop   firewalld.s ...

  3. CentOS7关闭防火墙方法

    在之前的版本中关闭防火墙等服务的命令是 service iptables stop /etc/init.d/iptables stop 在RHEL7中,其实没有这个服务 [root@rhel7 ~]# ...

  4. Centos7 关闭防火墙

    CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 1.直接关闭防火墙 systemctl stop firewalld.service #停止firew ...

  5. Centos7 关闭防火墙(转)

    转载地址:http://www.cnblogs.com/silent2012/archive/2015/07/28/4682770.html CentOS 7.0默认使用的是firewall作为防火墙 ...

  6. Centos7关闭防火墙与selinux

    CentOS 7.0默认使用的是firewall作为防火墙 直接关闭防火墙 systemctl stop firewalld.service #停止firewall systemctl disable ...

  7. 转载-CentOS7关闭防火墙

    原文地址-http://www.cnblogs.com/silent2012/archive/2015/07/28/4682770.html CentOS 7.0默认使用的是firewall作为防火墙 ...

  8. CentOS7 关闭防火墙和selinux

    本文将简单介绍在CentOS7上如何临时和永久关闭防火墙和selinux. 关闭防火墙 # 查看防火墙状态 [root@localhost ~]# systemctl status firewalld ...

  9. iptables详解与Centos7 关闭防火墙

    http://www.cnblogs.com/metoy/p/4320813.html CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 1.直接关闭防 ...

随机推荐

  1. TVM使用问题记录

    1.numpy提示repeat错误 错误信息为 One method of fixing this is to repeatedly uninstall numpy until none is fou ...

  2. YII2中controller中的behaviors中的behavior内部是如何被使用的?

    1. behaviors方法的调用: 在祖先对象components中有一个ensureBehaviors方法,代码如下: /** * Makes sure that the behaviors de ...

  3. TCP坚持定时器

    窗口探查(window probe) 当接收方TCP缓冲区没有剩余空间后,在ACK中会通知发送方window=0,此时发送方就暂停发送数据.当接收方TCP缓冲区又有空间后,会再次发送一个ACK,告知其 ...

  4. Go语言基础之操作MySQL

    Go语言操作MySQL MySQL是常用的关系型数据库,本文介绍了Go语言如何操作MySQL数据库. Go操作MySQL 连接 Go语言中的database/sql包提供了保证SQL或类SQL数据库的 ...

  5. PAT1005 继续(3n+1)猜想

    卡拉兹(Callatz)猜想已经在1001中给出了描述.在这个题目里,情况稍微有些复杂. 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数.例如对 n=3 进行验证的时 ...

  6. mysql.sock丢失问题

    执行下面命令即可 /usr/local/bin/mysqld_safe 摘录于:https://blog.csdn.net/qq_20008173/article/details/87280834

  7. FastDFS分布式图片服务器搭建

    一:Fastdfs简介 1. 什么是FastDFS FastDFS 是用 c 语言编写的一款开源的分布式文件系统.FastDFS 为互联网量身定制, 充分考虑了冗余备份.负载均衡.线性扩容等机制,并注 ...

  8. (六) Java数据库

    一.概述 程序开发没有数据库的参与,可以说几乎是不可能的.数据库和Java都已经有了简单的了解,现在的关键是对两者进行连接,起到这一作用的正是JDBC——Java Database Connectiv ...

  9. mongodb cursor用法

    为了营造大批量数据,我们可以这样写javascript脚本 for (var i=1;i<=10000;i++) { if(i%2==1) { db.cursortest.insert({_id ...

  10. AngularJs-变量

    <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...