CENTER OS7关闭防火墙
CentOS 7.0默认使用的是firewall作为防火墙,之前版本是使用iptables。
所以在CentOS 7执行下面命令是无法查看防火墙状态的。
[root@localhost ~]# service iptables status
Redirecting to /bin/systemctl status iptables.service
Unit iptables.service could not be found.
查看防火墙是否关闭
firewall-cmd --state
[root@localhost ~]# firewall-cmd --state
not running
[root@localhost ~]#
开启防火墙
[root@localhost ~]# systemctl start firewalld
[root@localhost ~]# firewall-cmd --state
running
[root@localhost ~]#
关闭防火墙
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# firewall-cmd --state
not running
[root@localhost ~]#
禁止firewall开机启动
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
这样设置的话,下次重启开机的时候就会禁止firewall的启动,即关闭状态。
设置firewall开机启动
[root@localhost ~]# systemctl enable firewalld
Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
这样设置之后,开机就会自动开启防火墙。
显示防火墙应用列表
[root@localhost ~]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: ssh dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[root@localhost ~]# firewall-cmd --add-service=ftp
success
[root@localhost ~]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: ssh dhcpv6-client ftp
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[root@localhost ~]#
使用firewall-cmd --add-service=ftp 之后,列表显示出多了一个ftp服务。
CENTER OS7关闭防火墙的更多相关文章
- center os7.2 apache+php+mysql环境配置并设置https访问
本人阿里云购买的center os7.2系统,小程序只支持https,因此需要配置https 安装apache yum -y install httpd systemctl start httpd a ...
- CentOS7使用firewalld打开关闭防火墙与端口(转载)
1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disabl ...
- Centos7 关闭防火墙
CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 1.直接关闭防火墙 systemctl stop firewalld.service #停止firew ...
- linux下如何关闭防火墙?如何查看防火墙当前的状态
从配置菜单关闭防火墙是不起作用的,索性在安装的时候就不要装防火墙查看防火墙状态:/etc/init.d/iptables status暂时关闭防火墙:/etc/init.d/iptables stop ...
- Centos7 关闭防火墙(转)
转载地址:http://www.cnblogs.com/silent2012/archive/2015/07/28/4682770.html CentOS 7.0默认使用的是firewall作为防火墙 ...
- 导入一些常用命令比如(rz),关闭防火墙外面可以访问
yum -y install lrzsz-----------导入常用命令 我在虚拟机上面启动了一个项目 这个原因是防火墙造成的,关闭防火墙 iptables -L 查看下 service ipt ...
- Centos7设置关闭防火墙
CentOS 7.0默认使用的是firewall作为防火墙,要想使用iptables必须重新设置一下. 1.关闭防火墙 [root@localhost ~]# systemctl stop firew ...
- centos关闭防火墙
Centos7 关闭防火墙 CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 1.直接关闭防火墙 systemctl stop firewalld.se ...
- Centos7 关闭防火墙(Firewalld ),使用防火墙(iptables)
1.直接关闭防火墙 systemctl stop firewalld.service: #停止firewall systemctl disable firewalld.service: #禁止fire ...
随机推荐
- Python 根据入栈顺利判定出栈顺序
1.读取入栈,出栈数据: 2.把数据分别转化成整数列表: 3.新建栈列表,用入栈数据进行压栈:如果栈列表不为空,并且栈顶层数据为出栈的元素:删除栈列表的顶层数据: 4.如果栈列表不为空,说明栈列表里面 ...
- 二维码生成器,基于python,segno库
import segno temp = input("Please enter value:") qr = segno.make(temp) qr.save("qrcod ...
- ‘’‘安装PyMouse,个人日志'''
管理员启动CMD 1.直接pip install pymouse,成功安装, 2.安装PyHook: https://www.lfd.uci.edu/~gohlke/pythonlibs/ (向下滑动 ...
- python面试题之如何读取大文件
① 利用生成器generator ②迭代器进行迭代遍历:for line in file 文章转载自Python黑洞网
- POJ 3764 The xor-longest Path (01字典树)
<题目链接> 题目大意: 给定一颗$n$个节点$(n\leq10^5)$,有边权的树,其边权$(0\leq w < 2^{31})$.让你求出这棵树上任意两个节点之间的异或最大值. ...
- 汇编语言之寄存器使用bx si di bp
转载自:https://www.cnblogs.com/youxin/archive/2012/05/29/2524780.html 如果你看到这篇博客时正在做第七章问题,强烈建议先去把8.1~8.4 ...
- 安卓构架组件——向项目添加组件(Adding Components to your Project)
在开始之前,建议阅读 应用架构指南. Before getting started, we recommend reading the Architecture Components Guide to ...
- R语言控制流
一般来说R语言是自上而下执行的,但是遇到特殊情况可能用到循环执行某些语句,这时候条件运算和循环就能派上用场了.
- MySQL语句优化方法(简单版)
基础回顾: sql语句是怎么样运行的? 一般来说,客户端发送sql语句到数据库服务器——数据库服务器进行运算并返回结果——客户端显示sql语句运行结果. 在本地运行时以workbench为例,客户端为 ...
- shell PATH示例