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 ...
随机推荐
- 原创 C++应用程序在Windows下的编译、链接:第一部分 概述
本文是对C++应用程序在Windows下的编译.链接的深入理解和分析,文章的目录如下: 我们先看第一章概述部分. 1概述 1.1编译工具简介 cl.exe是windows平台下的编译器,link.ex ...
- Javascript——arguments的shift问题谈方法“借用”
今天本来运行了打算这样的方法 arguments.shift() (shift方法是删除数组的第一个元素,例如var arr=[1,2,3,4,5]执行var a=arr.shift();之后,a的值 ...
- linux 安装mysql数据库——yum安装法
mysql数据库有多种安装方式,本文只介绍在Linux服务器上最实用.最快捷的mysql server安装方法.一.Linux服务器yum安装(CentOS6.3 64位) 所有在服务器上执行的命令, ...
- Linux系统用户和用户组介绍
1.请问如下登录环境故障的原理及解决办法? [root@server test]# useradd rr ##创建用户rr [root@server test]# id rr uid=510(rr) ...
- ubuntu关于引导修复[grub命令行][live linux]
第一种:grub命令行: ls 列出所有分区 ls /grub ls /grub 检查确认linux引导分区,如果linux单独/boot分区,就要采用如下命令进行检查: ls /boot/grub ...
- chkconfig
chkconfig的级别: 0:关机 1:单用户模式 2:无网络支持的多用户模式 3:有网络支持的多用户模式 4:保留,未使用 5:有网络支持有X-Windows(图形界面)支持的多用户模式 6:重新 ...
- Spring Mock
今天看别人的测试代码,发现有 MockMvc.MockHttpServletRequest.MockHttpServletResponse ,不知道是干啥的,百度下下才知道 Mock这个东东. 下 ...
- 搭建一套自己实用的.net架构(3)【ORM-Dapper+DapperExtensions】
现在成熟的ORM比比皆是,这里只介绍Dapper的使用(最起码我在使用它,已经运用到项目中,小伙伴们反馈还可以). 优点: 1.开源.轻量.小巧.上手容易. 2.支持的数据库还蛮多的, Mysql,S ...
- [LeetCode] Regular Expression Matching 正则表达式匹配
Implement regular expression matching with support for '.' and '*'. '.' Matches any single character ...
- C#文件目录操作完全手册
需要 using System.IO; 1) 相对路径转绝对路径string fullfolder = HttpContext.Current.Server.MapPath(folder); 2) 文 ...