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防火墙的关闭和开启(转)的更多相关文章

  1. Linux防火墙的关闭和开启

    1) 重启后生效 开启: chkconfig iptables on 关闭: chkconfig iptables off 2) 即时生效,重启后失效 开启: service iptables sta ...

  2. Linux CentOS中防火墙的关闭及开启端口

    注:CentOS7之前用来管理防火墙的工具是iptable,7之后使用的是Firewall 样例:在CentOS7上安装tomcat后,在linux本机上可以访问tomcat主页,http://ip: ...

  3. 一 SSH 无密码登陆 & Linux防火墙 & SELinux关闭

    如果系统环境崩溃.   调用/usr/bin/vim /etc/profile   SHH无密码登陆 所有要做得节点上运行   修改 host name vi /etc/sysconfig/netwo ...

  4. Linux 防火墙和SELinux的开启和关闭

    防火墙(firewalld) 临时关闭防火墙 systemctl stop firewalld 永久防火墙开机自关闭 systemctl disable firewalld 临时打开防火墙 syste ...

  5. Linux学习笔记之CentOS6.9 防火墙的关闭以及开启

    有的时候,我们需要对系统的防火墙进行操作,今天小编就给大家讲解一下如何开启以及关闭CentOS6.9系统下的防火墙. 输入:cat /etc/issue   查看版本 (一)通过service命令 s ...

  6. 【linux系列】linux防火墙的关闭开启

    即时生效 开启:service iptables start 关闭:service iptables stop 重启后生效 开启:chkconfig iptables on 关闭:chkconfig ...

  7. centos命令行系列之centos6防火墙的关闭以及开启

    输入:cat /etc/issue   查看版本 (一)通过service命令 注:service命令开启以及关闭防火墙为即时生效,下次重启机器的时候会自动复原 查看防火墙状态:service ipt ...

  8. CentOS 7防火墙的关闭与开启

    (1)CentOS 7.0默认使用的是firewall作为防火墙:若没有启用iptables 作为防火墙,则使用以下方式关闭防火墙: systemctl stop firewalld.service ...

  9. Linux防火墙(Iptables)的开启与关闭

    Linux防火墙(iptables)的开启与关闭 Linux中的防火墙主要是对iptables的设置和管理. 1. Linux防火墙(Iptables)重启系统生效 开启: chkconfig ipt ...

随机推荐

  1. PYPY_GC

    Author:Jin Date: 2014-7-8 http://doc.pypy.org/en/latest/windows.html http://www.pypy.org/download.ht ...

  2. Cascode MOSFET increases boost regulator's input- and output-voltage ranges

    Targeting use in portable-system applications that require raising a battery's voltage to a higher l ...

  3. AskUsingForm_c函数

    IDA SDK里面提供的UI(user interface)函数 AskUsingForm_c,该函数弹出一个对话框,而对话框的外观形式,就由此函数的第一个参数form(const char *类型) ...

  4. mysql字符串比较

    select '123'B is TRUE;  1 SET @a='123';            select '123'is TRUE;      0 select cast('222' as ...

  5. ssl 复制

    http://www.ttlsa.com/mysql/mysql-replication-base-on-ssl/ http://www.tuicool.com/articles/mi2iaq htt ...

  6. Are you sure your NDK_MODULE_PATH variable is properly defined?(2)

    Are you sure your NDK_MODULE_PATH variable is properly defined? STEP1:   MIND: 明确NDK_MODULE_PATH概念ht ...

  7. find命令专辑

    find命令使用技巧 查找文件,移动到某个目录 使用find和xargs 15条 linux Find 命令实际使用方法 find 命令用法 find命令使用经验 find用法小结 find与xarg ...

  8. Openshift 3.11和LDAP的集成

    1. OpenLDAP的安装 只记录主要步骤,详细可参考 https://access.redhat.com/solutions/2484371 # yum install -y openldap o ...

  9. MySQL模糊查询(like)时区分大小写

    问题说明:通过上面的语句,你会发现MySQL的like查询是不区分大小写的,因为我的失误,把Joe写成了joe才发现了这个东东吧.但是,有时候,我们需要区分大小写的是,该怎么办呢?解决方法如下: 方法 ...

  10. iOS: 转载CoreData数据库框架

    iphone-CoreData的使用详解 一.概念 1.Core Data 是数据持久化存储的最佳方式 2.数据最终的存储类型可以是:SQLite数据库,XML,二进制,内存里,或自定义数据类型 在M ...