linux防火墙状态查看的方法

1、基本操作

# 查看防火墙状态

service iptables status

# 停止防火墙

service iptables stop

# 启动防火墙

service iptables start

# 重启防火墙

service iptables restart

# 永久关闭防火墙

chkconfig iptables off

# 永久关闭后重启

chkconfig iptables on

2、开启80端口

vim /etc/sysconfig/iptables

# 加入如下代码

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

保存退出后重启防火墙

service iptables restart

二、firewall防火墙

1、查看firewall服务状态

systemctl status firewalld

出现Active: active (running)切高亮显示则表示是启动状态。

出现 Active: inactive (dead)灰色表示停止,看单词也行。

2、查看firewall的状态

firewall-cmd --state

3、开启、重启、关闭、firewalld.service服务

# 开启service firewalld start# 重启service firewalld restart# 关闭service firewalld stop

4、查看防火墙规则

firewall-cmd --list-all

5、查询、开放、关闭端口

# 查询端口是否开放

firewall-cmd --query-port=8080/tcp

# 开放80端口

firewall-cmd --permanent --add-port=80/tcp

# 移除端口

firewall-cmd --permanent --remove-port=8080/tcp

#重启防火墙(修改配置后要重启防火墙)

firewall-cmd --reload

参数解释

1、firwall-cmd:是Linux提供的操作firewall的一个工具;

2、--permanent:表示设置为持久;

3、--add-port:标识添加的端口;

到此这篇关于linux防火墙状态查看的方法实例的文章就介绍到这了,更多相关linux防火墙状态查看内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!

时间: 2020-02-25

linux防火墙查看方法有,linux防火墙状态查看的方法实例相关推荐

  1. linux服务器上tcp有大量time_wait状态的解决方法和原因解释

    在检查服务器时,发现有很多连接超时情况出现,用netstat命令查看,tcp的time_wait状态较多,需要进行优化. 1. 看一下现在time_wait的数量 netstat -an | grep ...

  2. linux 防火墙查看出错,linux防火墙状态查看的方法实例

    linux防火墙状态查看的方法 1.基本操作 # 查看防火墙状态 service iptables status # 停止防火墙 service iptables stop # 启动防火墙 servi ...

  3. linux防火墙状态确认,linux防火墙状态查看的方法

    小编给大家整理了关于linux防火墙状态查看的方法实例的相关内容,需要的朋友们可以学习下. linux防火墙状态查看的方法 1.基本操作 # 查看防火墙状态 service iptables stat ...

  4. centos打开指定端口(443),Linux防火墙状态查看的方法

    1.防火墙基本操作 #查看防火墙是否开启(如果显示running,则防火墙为开启状态): firewall-cmd --state#关闭防火墙: systemctl stop firewalld.se ...

  5. linux的iptable开启命令,linux防火墙查看状态firewall、iptable

    一.iptables防火墙 1.基本操作 查看防火墙状态 service iptables status 停止防火墙 service iptables stop 启动防火墙 service iptab ...

  6. linux怎么查看防火墙开放的端口,linux查看防火墙状态和对外开放的端口状态

    1.查看防火墙状态 查看防火墙状态 systemctl status firewalld 开启防火墙 systemctl start firewalld 关闭防火墙 systemctl stop fi ...

  7. linux防火墙状态查看/打开/关闭及端口/打开/关闭操作记录

    防火墙:大体分为主机防火墙和网络防火墙. 主机防火墙:针对于单个主机进行防护. 网络防火墙:往往处于网络入口或边缘,针对于网络入口进行防护,服务于防火墙背后的本地局域网. 网络防火墙和主机防火墙并不冲 ...

  8. Linux防火墙状态查看以及端口设置

    目录 查看防火墙状态 开放某个端口 删除某个端口 查看端口号 查看防火墙状态 // 查看防火墙状态 firewall-cmd --state// 查看防火墙服务 systemctl status fi ...

  9. linux 连接跟踪nf_conntrack 与 NAT和状态防火墙

    本文主要记录对于连接跟踪以及其主要应用的NAT和状态iptables的学习内容 连接跟踪 什么是连接跟踪? 连接跟踪是Linux内核中引入的nf_conntrack 模块所实现的功能,同时支持IPv4 ...

最新文章

  1. 树莓派/PC实现实时摄像头数据共享(Python—picamera)
  2. 网上复制代码需谨慎,莫名其妙报错看这里!
  3. data spring 指定时区_Spring 框架基础(05):Mvc架构模式,执行流程详解
  4. 前后端敏感数据加密方案及实现_03
  5. Android基于UDP的局域网聊天通信
  6. 计算机系统-理论-内存分页机制/线性地址/虚拟内存
  7. 解决了asp.net 关于服务器版本不正确的问题
  8. 蓝桥杯 前缀判断——2013年省赛C/C++A组真题5
  9. 史上最简单的上传文件到linux系统方法
  10. web前端简历个人技能该怎么写?
  11. Java实现多张图片转pdf
  12. [leetcode]: 506. Relative Ranks
  13. 微型计算机延时,延迟时间
  14. 【攻防世界】十七、ics-05
  15. maven 光速入门攻略01
  16. mysql8.0.21官网安装步骤_MySQL8.0.21安装步骤及出现问题解决方案
  17. python算法技巧——列表、字符串实用技巧
  18. http://windowsandroid.cn.uptodown.com/download
  19. AtCoder Beginner Contest 234 G - Divide a Sequence
  20. 百度Apollo自动驾驶学习笔记

热门文章

  1. 10大理由告诉你为什么要学习Python
  2. linux php oracle 乱码,Linux安装Oracle中文乱码的解决
  3. 【QML学习8】鼠标与触摸处理
  4. Java 算法 星际交流
  5. 计算机核心基础知识总结----计算机组成原理和操作系统篇
  6. linux-sfdisk用法
  7. Linux中grep 显示满足多个关键字的内容或排除含有关键字内容
  8. app性能测试-cpu监控
  9. 《谁动了我的奶酪》阅读笔记
  10. G20峰会在印度尼西亚举行,虹膜识别身份认证让佩戴面纱、口罩和留大胡子不再困扰