一:下面是red hat/CentOs7关闭防火墙的命令!

1:查看防火状态

systemctl status firewalld

service  iptables status

2:暂时关闭防火墙

systemctl stop firewalld

service  iptables stop

3:永久关闭防火墙

systemctl disable firewalld

chkconfig iptables off

4:重启防火墙

systemctl enable firewalld

service iptables restart  

5:永久关闭后重启

//暂时还没有试过

chkconfig iptables on

二、firewalld

Centos7默认安装了firewalld,如果没有安装的话,可以使用 yum install firewalld firewalld-config进行安装。

1.启动防火墙

systemctl start firewalld
2.禁用防火墙 systemctl stop firewalld
3.设置开机启动 systemctl enable firewalld
4.停止并禁用开机启动 sytemctl disable firewalld
5.重启防火墙 firewall-cmd --reload
6.查看状态 systemctl status firewalld或者 firewall-cmd --state
7.查看版本 firewall-cmd --version
8.查看帮助 firewall-cmd --help
9.查看区域信息 firewall-cmd --get-active-zones
10.查看指定接口所属区域信息 firewall-cmd --get-zone-of-interface=eth0
11.拒绝所有包 firewall-cmd --panic-on
12.取消拒绝状态 firewall-cmd --panic-off
13.查看是否拒绝 firewall-cmd --query-panic
14.将接口添加到区域(默认接口都在public) firewall-cmd --zone=public --add-interface=eth0(永久生效再加上 --permanent 然后reload防火墙)
15.设置默认接口区域 firewall-cmd --set-default-zone=public(立即生效,无需重启)
16.更新防火墙规则 firewall-cmd --reload或firewall-cmd --complete-reload(两者的区别就是第一个无需断开连接,就是firewalld特性之一动态
添加规则,第二个需要断开连接,类似重启服务)
17.查看指定区域所有打开的端口 firewall-cmd --zone=public --list-ports
18.在指定区域打开端口(记得重启防火墙)

linux关闭防火墙与开启防火墙命令的更多相关文章

  1. Linux 关闭正在运行的程序---命令

    Ctrl + C 终止 Ctrl + D 退出 Ctrl + S 挂起 Ctrl + Q 解挂 Ctrl + Z 强制结束

  2. Linux系统基础优化及常用命令

    Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ifconfig 查询.设置网卡和 ...

  3. 8,Linux系统基础优化及常用命令

    Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ifconfig 查询.设置网卡和 ...

  4. Linux 系统基础优化和常用命令

    目录 Linux 系统基础优化和常用命令 软连接 tar解压命令 gzip命令 netstart命令 ps命令 kill命令 killall命令 SELinux功能 iptables防火墙 Linux ...

  5. 运维 07 Linux系统基础优化及常用命令

    Linux系统基础优化及常用命令   Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令 ...

  6. Linux关闭/开启防火墙命令

    Linux还是比较常用的,于是我研究了一下Linux关闭防火墙命令,在这里拿出来和大家分享一下,希望你能学会Linux关闭防火墙命令 . 1) 永久性生效,重启后不会复原 开启: chkconfig ...

  7. Linux关闭开启防火墙命令

    在外部访问CentOS中部署应用时,需要关闭防火墙. 关闭防火墙命令:systemctl stop firewalld.service 开启防火墙:systemctl start firewalld. ...

  8. Linux系统目录结构,Shell脚本;关闭和开启防火墙

    Linux系统目录结构 目录 描述 备注 /bin a.存放着最经常使用的命令 b.可执行文件,用户命令 c.构建最小系统所需要的命令 /boot a.内核与启动文件 b.系统启动相关文件 c.启动L ...

  9. lunix如何查看防火墙是否关闭和关闭开启防火墙命令

    查看防火墙是否关闭的命令如下: 1.通过 /etc/init.d/iptables status 或者 service iptables status命令 2.通过 iptables -L命令 查看 ...

随机推荐

  1. c++ vector释放概述

    这里仅为概述,具体的详情分析,可以Google下,会得到更详尽的解释. 1.函数clear和erase都将数组的size清空,但对应的空间并没有回收,而且,一直push_baclk, 对应的capac ...

  2. 【LeetCode】1413. 逐步求和得到正数的最小值 Minimum Value to Get Positive Step by Step Sum

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 求和 日期 题目地址:https://leetcode ...

  3. 【LeetCode】Longest Word in Dictionary through Deleting 解题报告

    [LeetCode]Longest Word in Dictionary through Deleting 解题报告 标签(空格分隔): LeetCode 题目地址:https://leetcode. ...

  4. 【LeetCode】831. Masking Personal Information 解题报告(Python)

    [LeetCode]831. Masking Personal Information 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzh ...

  5. Codeforces 1113C: Sasha and a Bit of Relax(位运算|异或)

    time limit per test: 1 secondmemory limit per test: 256 megabytesinput: standard inputoutput: standa ...

  6. Capstone CS5265替代LT8711龙迅|Typec转HDMI4K60HZ投屏转换方案

    LT8711是一款高性能C型/DP1.2至HDMI2.0转换器,设计用于将USB typec或DP1.2源连接至HDMI2.0接收器.LT8711集成了兼容DP1.2的接收机和兼容HDMI2.0的发射 ...

  7. Layui 的内置jquery 版本

    //layui-v2.4.5 的内置jquery 版本. console.log(layui.$.fn.jquery);//=> 1.12.3 可以使用内置jq的方法: 方法一: layui.u ...

  8. WPF使用字体图标

    首先我们要有字体文件,可以去阿里巴巴矢量图标库下载,下载解压后可以看到如下文件: 其中,iconfont.ttf就是字体文件,我们将该文件引入到自己的项目中,将iconfont.ttf文件的属性中&q ...

  9. winform 自定义自动完成控件

    做过前端的朋友肯定很清楚自动完成控件,很多优秀的前端框架都会带有自动完成控件,同样的,winform也有,在我们的TextBox和ComboBox中,只需要设置AutoCompleteSource属性 ...

  10. WPF使用MVVM(一)-属性绑定

    WPF使用MVVM(一)-属性绑定 简单介绍MVVM MVVM是Model(数据类型),View(界面),ViewModel(数据与界面之间的桥梁)的缩写,是一种编程模式,优点一劳永逸,初步增加一些逻 ...