CentOS 7 防火墙常用操作及常见问题处理
一、常用操作
1、启动防火墙:
systemctl start firewalld.service
2、关闭防火墙:
systemctl stop firewalld.service
3、添加放行端口:
firewall-cmd --zone=public --add-port=8161/tcp --permanent (--permanent永久生效,没有此参数重启后失效)
4、锁定防火墙服务(防止添加端口等操作):
systemctl mask firewalld
5、取消锁定:
systemctl unmask firewalld
二、常见问题及解决办法
1、当出现如下 “firewalld.service: Unit is masked” 错误时,说明服务被锁定,此时我们取消锁定即可:
图1-1
三、附录
CentOS 7 默认使用的是firewall作为防火墙,可通过如下操作改为iptables防火墙。
1、停止 firewall
systemctl stop firewalld.service
2、禁止 firewall 开机启动
systemctl disable firewalld.service
3、安装 iptables-services
yum install iptables-services
4、启用iptables-services
systemctl enable iptables
5、启动 iptables
service iptables start
备注:
本文仅记录自己遇到并且实际操作解决过的问题,后续会持续更新。
CentOS 7 防火墙常用操作及常见问题处理的更多相关文章
- centos 7 防火墙相关操作
centos 7 防火墙相关操作 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewal ...
- firewall防火墙常用操作
# firewall防火墙常用操作 - 启动```systemctl start firewalld```- 停止```systemctl stop firewalld```- 重启```system ...
- CentOS + Nginx 的常用操作指令总结
CentOS + Nginx 的常用操作指令总结 一. 关于CentOS 查看 yum 源是否存在 yum list | grep nginx 如果不存在 或者 不是自己想要的版本 可以自己设置Ngi ...
- mysql常用操作及常见问题
常用操作 mysql备份: --整库备份 docker exec 容器ID mysqldump -uroot -p密码 --databases 库名 > 库名.sql --仅导出表和数据 mys ...
- CentOS中Mysql常用操作
安装mysqlyum -y install mysql-server 修改mysql配置vi /etc/my.cnf 这里会有很多需要注意的配置项,后面会有专门的笔记暂时修改一下编码(添加在密码下方) ...
- centos命令行常用操作
1.查看某个端口占用 lsof -i tcp:80 2.查看是否安装了防火墙 service iptables status 查看是否启用防火墙/etc/init.d/iptables status ...
- Linux防火墙常用操作
/tcp —— 配置白名单 sudo systemctl start firewalld — 启动防火墙 sudo firewall-cmd --state - 看状态 sudo firewall-c ...
- CentOS 7 Firewalld 常用操作
1.简介 Zone 级别 drop: 丢弃所有进入的包,而不给出任何响应block: 拒绝所有外部发起的连接,允许内部发起的连接public: 允许指定的进入连接external: 同上,对伪装的进入 ...
- CentOS 配置防火墙操作实例(启、停、开、闭端口):
CentOS 配置防火墙操作实例(启.停.开.闭端口): 注:防火墙的基本操作命令: 查询防火墙状态: [root@localhost ~]# service iptables status< ...
随机推荐
- hbase hbck
Number of Tables: 7Number of live region servers: 3Number of dead region servers: 0Number of empty R ...
- Misc套路记录
1.对于给定的二维码图片不能直接扫描出来的可以进行反色在进行扫描,反色可以直接选中图片然后就会进行反色.2.局域网中抓取的数据包的加密方式可能是aes加密.3.凯撒加密可能是变种的凯撒加密,可能奇数偶 ...
- 学号 20175329 《Java程序设计》第10周学习总结
20175329 <Java程序设计>第十周学习总结 教材学习内容总结 线程与进程 进程时程序的一次动态执行过程.线程是比进程更小的执行单位,一个进程在其执行过程中,可以产生多个线程. J ...
- C# async await and state machine
Async Await and the Generated StateMachine https://www.codeproject.com/Articles/535635/Async-Await-a ...
- koa 项目实战(五)全球公用头像的使用
1.安装模块 npm install gravatar --save 2.使用 根目录/routes/api/users.js const gravatar = require('gravatar') ...
- centos 6和centos7关闭防火墙的方法
centos 6 关闭命令: service iptables stop 永久关闭防火墙:chkconfig iptables off 两个命令同时运行,运行完成后查看防火墙关闭状态 ...
- Hadoop : MapReduce中的Shuffle和Sort分析
地址 MapReduce 是现今一个非常流行的分布式计算框架,它被设计用于并行计算海量数据.第一个提出该技术框架的是Google 公司,而Google 的灵感则来自于函数式编程语言,如LISP,Sch ...
- LC 963. Minimum Area Rectangle II
Given a set of points in the xy-plane, determine the minimum area of any rectangle formed from these ...
- linux常用命令(7)cp命令
cp命令用来复制文件或者目录,是Linux系统中最常用的命令之一.一般情况下,shell会设置一个别名,在命令行下复制文件时,如果目标文件已经存在,就会询问是否覆盖,不管你是否使用-i参数.但是如果是 ...
- 读取web工程中.properties资源文件的模板代码
读取web工程中.properties资源文件的模板代码 // 读取web工程中.properties资源文件的模板代码 private void test2() throws IOException ...