Centos7防火墙常用命令及mask锁定不能添加端口问题
一、开放端口
sudo firewall-cmd --zone=public --add-port=3000/tcp --permanent
sudo firewall-cmd --reload
二、关闭防火墙
//临时关闭防火墙,重启后会重新自动打开
systemctl restart firewalld
//检查防火墙状态
firewall-cmd --state
firewall-cmd --list-all
//Disable firewall
systemctl disable firewalld
systemctl stop firewalld
systemctl status firewalld
//Enable firewall
systemctl enable firewalld
systemctl start firewalld
systemctl status firewalld
三、查看防火墙规则
firewall-cmd --list-all
四、执行 systemctl start firewalld 命令后出现Failed to start firewalld.service: Unit is masked
执行命令,即可实现取消服务的锁定 # systemctl unmask firewalld 下次需要锁定该服务时执行 # systemctl mask firewalld
五。常见问题:
更新了Python版本(version>=Python3),cnetos7系统自带的是Python2.7。
在安装python时,一般教程都会提示说,安装成功后,yum不能用,需要修改yum配置文件(vim /usr/bin/yum)。 把文件头部的#!/usr/bin/python改成#!/usr/bin/python2.7
那么这个方法,继续可以在这个问题上使用:
第一步,vim /usr/bin/firewall-cmd, 将#!/usr/bin/python -Es 改为 #!/usr/bin/python2.7 -Es(到目前为止,上面提到的问题已解决)
第二步,vim /usr/sbin/firewalld, 将#!/usr/bin/python -Es 改为 #!/usr/bin/python2.7 -Es (这一步是针对于防火墙报错,进行的修改)
firewall-cmd --list-ports
Centos7防火墙常用命令及mask锁定不能添加端口问题的更多相关文章
- Centos7防火墙常用命令
有些人安装的linux的系统默认防火墙不是iptables,而是firewall,那就得使用以下方式关闭防火墙了. >>>关闭防火墙 systemctl stop firewalld ...
- Centos7 防火墙常用命令 开启 关闭防火墙
如果你的系统上没有安装使用命令安装 #yum install firewalld //安装firewalld 防火墙 开启服务 # systemctl start firewalld.service ...
- linux下防火墙开启某个端口号及防火墙常用命令使用
linux防火墙常用命令 1.永久性生效,重启后不会复原 开启:chkconfigiptables on 关闭:chkconfigiptables off 2.即时生效,重启后复原 重启防火墙 方式一 ...
- 【CentOS7】常用命令
[CentOS7]常用命令 转载:https://www.cnblogs.com/yangchongxing/p/10646640.html 目录 ========================== ...
- Centos7 防火墙常用配置及说明
一. Centos7和Centos6 防火墙的区别: 使用的工具不一样了.Centos6 使用的是iptables ,Centos7 使用的是filewall iptables 用于过滤数据包,属于网 ...
- iptables防火墙常用命令
iptables防火墙启动停止和基本操作 iptables是centos7之前常用的防火墙,在centos7上使用了firewall 防火墙基本操作: # 查询防火墙状态 service iptabl ...
- Fortigate防火墙常用命令
命令结构 #config 对策略,对象等进行配置 #get 查看相关对象的参数 #show 查看配置文件 #diagnose 诊断命令 #execute 常用的工具命令,如ping treacer ...
- centos6和centos7中常用命令区别
以前一直接触的是centos6,最近因为新项目接触到centos7,发现有些命令还是有差异的(从centos7开始使用systemctl来管理服务和程序,包括了service和chkconfig),现 ...
- firewalld管理防火墙常用命令
1.查看防火墙的状态 [root@localhost HMK]# firewall-cmd --state 查看防火墙的运行状态 not running [root@localhost HMK]# s ...
随机推荐
- C++怎么实现线程安全
muduo库学习笔记1-C++多线程系统编程 网上都说这本书很适合初学者入门学习, 我今天开始准备从头再来; 第一章线程安全的对象管理 对象的生与死不能由对象自身拥有的mutex(互斥器)来保护; 如 ...
- 使用openssl命令制作ecc证书
# openssl ecparam -out EccCA.key -name prime256v1 -genkey # openssl req -config openssl.cnf -key Ecc ...
- h5 右下角浮动按钮, 纯css实现
2017年11月22日19:00:22 效果: 代码: /** 右下角跳转按钮 跳转到列表 */ #list_note_icon { position: fixed; ...
- JNI 开发基础篇:Android开发中os文件的探索
正题: android开发中,时长会遇到os文件的使用,那么os文件到底是什么?在这篇文章中会进行说明. .os文件在android中意味着C语言书写的方法,经android提供的ndk进行编译,从而 ...
- liunx 利用nginx 实现负载均衡
一般采用软件实现负载均衡的有Nginx.apache.nginx 近年来使用频繁,其官网上面显示可以承载5万并发访问量,太牛了. nginx 相比 apache优势明显:Nginx 服务程序比较稳定, ...
- swift 实践- 12 -- UIPickerView
import UIKit class ViewController: UIViewController , UIPickerViewDelegate,UIPickerViewDataSource{ v ...
- Netty多人聊天室
在简单聊天室的代码中修改ChatServerHandler类,就可以模拟多人聊天的功能 package com.cppdy.server; import io.netty.channel.Channe ...
- Socket网络编程(一)
1.什么是网络通讯?(udp.tcp.netty.mina) udp:漂流瓶,每个人都可以向大海里面扔漂流瓶,不管有没有人捡到.(不管接收方有没有,我只往指定的地址发送东西,64kb以内) tcp:电 ...
- Android 基础 一 AndroidManifest.xml
一.概述 AndroidManifest.xml是Android应用的入口文件,它描述了package中暴露的组件(activities, services, 等等),他们各自的实现类,各种能被处理的 ...
- Maven集成SSM
目录 Maven 集成SSM 添加log4j配置文件 配置web.xml 添加编码过滤器 添加put和delete请求 配置springmvc.xml 配置文件上传 配置druid连接池信息 配置sq ...