centos 7.0 firewall 防火墙常用命令
1.查看防火墙是否在运行 firewall-cmd --state
[root@localhost ~]# firewall-cmd --state
running
2.查看都有哪些端口添加到例外 firewall-cmd --permanent --list-port
permanent 永久配置
[root@localhost ~]# firewall-cmd --permanent --list-port
80/tcp
3.添加端口到例外 firewall-cmd --permanent --zone=public --add-port=48489/tcp
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-port=48489/tcp
success
查看永久例外的端口列表
[root@localhost ~]# firewall-cmd --permanent --list-port
80/tcp 48489/tcp
4.删除端口例外 firewall-cmd --permanent --remove-port=80/tcp
[root@localhost ~]# firewall-cmd --permanent --remove-port=80/tcp
success
查看端口列表
[root@localhost ~]# firewall-cmd --permanent --list-port
48489/tcp
5. 停止firewald防火墙 systemctl stop firewalld
[root@localhost /]# systemctl stop firewalld
[root@localhost /]# firewall-cmd --state
not running
6.启动firewalld防火墙
systemctl start firewalld
在关闭防火墙后 仍然不能访问nginx,需要查看是否开启nginx进程
ps -ef | grep nginx 以下结果就是系统自带的nginx 说明并不没有开启服务
[root@localhost etc]# ps -ef | grep nginx
root      2340  2188  0 04:41 pts/0    00:00:00 grep --color=auto nginx
centos 7.0 firewall 防火墙常用命令的更多相关文章
- CentOS 7.0 firewall防火墙关闭firewall作为防火墙,这里改为iptables防火墙
		
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤: 1.先检查是否安装了: iptables service iptables status 2.安装ip ...
 - CentOS 7.0 Firewall防火墙配置
		
启动停止 获取firewall状态 systemctl status firewalld.service firewall-cmd --state 开启停止防火墙 开机启动:systemctl ena ...
 - Centos下磁盘管理的常用命令记录(如查找大文件)
		
Centos下磁盘管理的常用命令记录 查看系统磁盘空间占用,使用命令: df -h 结果: 查看磁盘inode使用情况,如果inode用完了,磁盘就没法写入新的内容了: df -i 结果: 如何查找磁 ...
 - linux下防火墙开启某个端口号及防火墙常用命令使用
		
linux防火墙常用命令 1.永久性生效,重启后不会复原 开启:chkconfigiptables on 关闭:chkconfigiptables off 2.即时生效,重启后复原 重启防火墙 方式一 ...
 - firewall防火墙常用操作
		
# firewall防火墙常用操作 - 启动```systemctl start firewalld```- 停止```systemctl stop firewalld```- 重启```system ...
 - CentOS 7中firewall防火墙详解和配置以及切换为iptables防火墙
		
官方文档介绍地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Gui ...
 - CentOS 7中firewall防火墙详解和配置以及切换为iptables防火墙--转载
		
最近在linux(这里用到的是Centos7的64位版本)安装nginx时,在开放80端口时用iptables设置端口 和重启服务发现提示未找到文件,在网络上收集查找后发现在Centos7中iptab ...
 - Centos7防火墙常用命令
		
有些人安装的linux的系统默认防火墙不是iptables,而是firewall,那就得使用以下方式关闭防火墙了. >>>关闭防火墙 systemctl stop firewalld ...
 - Fortigate防火墙常用命令
		
命令结构 #config 对策略,对象等进行配置 #get 查看相关对象的参数 #show 查看配置文件 #diagnose 诊断命令 #execute 常用的工具命令,如ping treacer ...
 
随机推荐
- jQuery解决iframe高度自适应代码
			
网上查了好多用着都不行,自己搞定了:在包含iframe的页面中加入以下脚本,基本思想是在iframe加载内容后重新设置高度,下面代码尽在IE6中用过,没在其他浏览器中测试. 代码如下: <scr ...
 - C#中DateTime.Ticks属性及Unix时间戳转换
			
1.相关概念 DateTime.Ticks:表示0001 年 1 月 1 日午夜 12:00:00 以来所经历的 100 纳秒数,即Ticks的属性为100纳秒(1Ticks = 0.0001毫秒). ...
 - Linux基础练习题(二)
			
Linux基础练习题(二) 1.复制/etc/skel目录为/home/tuer1,要求/home/tuser1及其内部文件的属组和其它用户均没有任何访问权限. [root@www ~]# cp -r ...
 - DevExpress ChartControl 样式设置
			
第三方控件,设置ChartControl的样式,仅供参考 Demo: <Grid> <Grid.Resources> <SolidColorBrush x:Key=&qu ...
 - 关于java的递归写法,经典的Fibonacci数的问题
			
经典的Fibonacci数的问题 主要想展示一下迭代与递归,以及尾递归的三种写法,以及他们各自的时间性能. public class Fibonacci { /*迭代*/ public static ...
 - [LeetCode] Partition Equal Subset Sum 相同子集和分割
			
Given a non-empty array containing only positive integers, find if the array can be partitioned into ...
 - [LeetCode] Transpose File 转置文件
			
Given a text file file.txt, transpose its content. You may assume that each row has the same number ...
 - [LeetCode] Length of Last Word 求末尾单词的长度
			
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the l ...
 - [LeetCode] Reverse Integer 翻转整数
			
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to ...
 - Intellij IDEA 快捷键
			
Ctrl+Shift + Enter,语句完成 "!",否定完成,输入表达式时按 "!"键 Ctrl+E,最近的文件 Ctrl+Shift+E,最近更改的文件 ...