CentOS7打开、关闭防火墙。
CentOS7 以上机器一些命令和低版本CentOS是有些差异的,本文只针对CentOS7 以上版本。
CentOS7使用firewalld打开关闭防火墙与端口
1、firewalld的基本使用
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl disable firewalld
开机启用 : systemctl enable firewalld
2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled
查看启动失败的服务列表:systemctl --failed
3.配置firewalld-cmd
查看版本: firewall-cmd --version
查看帮助: firewall-cmd --help
显示状态: firewall-cmd --state
查看所有打开的端口: firewall-cmd --zone=public --list-ports
更新防火墙规则: firewall-cmd --reload
查看区域信息: firewall-cmd --get-active-zones
查看指定接口所属区域: firewall-cmd --get-zone-of-interface=eth0
拒绝所有包:firewall-cmd --panic-on
取消拒绝状态: firewall-cmd --panic-off
查看是否拒绝: firewall-cmd --query-panic
如何开启一个端口
添加
firewall-cmd --zone=public --add-port=80/tcp --permanent (–permanent永久生效,没有此参数重启后失效)
重新载入
firewall-cmd --reload
查看
firewall-cmd --zone= public --query-port=80/tcp
删除
firewall-cmd --zone= public --remove-port=80/tcp --permanent
CentOS7打开、关闭防火墙。的更多相关文章
- 【Linux】CentOS7 打开关闭防火墙及端口
一.centos7版本对防火墙进行加强,不再使用原来的iptables,启用firewalld1.firewalld的基本使用启动: systemctl start firewalld查状态:syst ...
- CentOS7打开关闭防火墙与端口
http://www.javahelp.com.cn/h-nd-747.html#_np=153_1707
- CentOS7使用firewalld打开关闭防火墙与端口(转载)
1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disabl ...
- 关于学习CentOS7使用firewalld打开关闭防火墙和端口
1.firewalld简介 firewalld是centos7的一大特点,主要有两个优点:一是支持动态更新,不需要重启服务:二就是加入了防火墙的“zone”概念. firewalld有图形界面和工具界 ...
- CentOS7使用httpd apache 和firewalld打开关闭防火墙与端口
Centos7 使用systemctl 工具操作命令 systemctl 是Centos7的服务管理工具中的主要工具 ,它融合之前service和chkconfig的功能于一体 一.httpd的设置 ...
- CentOS7使用firewalld打开关闭防火墙与端口(转)
CentOS7使用firewalld打开关闭防火墙与端口 1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop ...
- CentOS7/6 关闭防火墙
CentOS6关闭防火墙使用以下命令, //临时关闭 service iptables stop //禁止开机启动 chkconfig iptables off CentOS7中若使用同样的命令会报错 ...
- Centos7永久关闭防火墙
Centos7永久关闭防火墙 查看防火墙状态: systemctl status firewalld.service 绿的running表示防火墙开启 执行关闭命令: systemctl stop f ...
- 转 CentOS7使用firewalld打开关闭防火墙与端口
http://blog.csdn.net/huxu981598436/article/details/54864260 开启端口命令 输入firewall-cmd --query-port=6379/ ...
- centos7上关闭防火墙
centos7上默认开启的是+firewalld,关闭了iptables 停止防护墙: systemctl stop firewalld.service 开机不启动: systemctl disabl ...
随机推荐
- c程序内存检测工具 - Valgrind
常用C程序内存泄露检测工具 https://blog.csdn.net/u012662731/article/details/78652651
- PHP匿名函数、闭包、function use
匿名函数,也叫闭包函数(closures) ,允许临时创建一个没有制定名称的函数.最常用作回调函数(callback)参数的值. 闭包函数也可以作为变量的值来使用.PHP将会自动把此种表达式转换成内置 ...
- sqlserver刷新视图
sqlserver 用于刷新当前数据库所有视图的存储过程 create procedure dbo.proc_refreshview as begin ) declare cur_view curso ...
- 昨天周末晚上没有出去,码了一小段,先留着kangkang。
昨天周末晚上没有出去,码了一小段,先留着kangkang. import numpy as npimport matplotlibmatplotlib.use('Agg')import matplot ...
- goroutine并发之callback回调
玩玩 package main import ( "fmt" "strings" "sync" ) var wait sync.WaitGr ...
- 0day2安全——笔记4(修改临界变量)
第二章 修改临界变量 #include <stdio.h> #include <string.h> #define PASSWORD "1234567" i ...
- C# List<T> 转 DataTable
C# List<T>转DataTable 学习自:博客园 Overview 数据!!个人认为程序就是将数据变着花样的显示它.那么这个时候我们的数据处理和获取就时我们的关键一步,如果你数据都 ...
- awk命令使用整理
1. awk默认以空格分隔, 可摘出指定位置的内容, 通常用法如下( 文件名称为file.txt ): 文件中行内容为: 12:3 a 4:56 b awk '{print $1}' ...
- python中append的使用
没有系统地学习过python,最近在append的使用上遇到了大问题,吃到了苦头 之前一直单纯地认为通过append把数添加到list中,不需要提前开空间,非常便利,但却没有意识到这个过程并不是值传递 ...
- [LeetCode] 42. Trapping Rain Water 收集雨水
Given n non-negative integers representing an elevation map where the width of each bar is 1, comput ...