Centos7.5 firewalld防火墙配置
CentOS 7.0默认使用的是firewall作为防火墙
1、查看firewall服务状态
systemctl status firewalld

2、查看firewall的状态
firewall-cmd --state

3、开启、重启、关闭、firewalld.service服务
#查看linux哪些程序正在使用互联网
firewall-cmd --permanent --list-services ssh dhcpv6-client
# 开启
service firewalld start
# 重启
service firewalld restart

# 关闭
service firewalld stop
4、查看防火墙规则
firewall-cmd --list-all

停止firewall
systemctl stop firewalld.service
禁止firewall开机启动
systemctl disable firewalld.service
5、查询、开放、关闭端口
# 查询端口是否开放
firewall-cmd --query-port=8080/tcp

# 开放80端口
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=8080-8085/tcp

# 移除端口
firewall-cmd --permanent --remove-port=8080/tcp
查看防火墙的开放的端口
firewall-cmd --permanent --list-ports
#重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload
# 参数解释
1、firwall-cmd:是Linux提供的操作firewall的一个工具;
2、--permanent:表示设置为持久;
3、--add-port:标识添加的端口;
常用命令配置白名单,限制指定ip只能访问服务器指定的端口和去掉开通的端口
#配置规则
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="指定的ip地址" port protocol="tcp" prot="指定的端口" accept" #配置所有端口都可以访问
firewall-cmd --permanent --zone=public --add-port=8080/tcp #批量配置规则
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="指定的ip地址段(192.168.1.0/24)" port protocol="tcp" prot="指定的端口" accept" #reload配置生效
firewall-cmd --reload #关闭端口
firewall-cmd --zone=public --remove-port=80/tcp --permanent #批量添加区间端口
firewall-cmd --zone=public --add-port=4400-4600/udp --permanent #查看防火墙排除端口
firewall-cmd --permanent --list-port #查看所有开放的端口
iptables -L -n
Centos7.5 firewalld防火墙配置的更多相关文章
- CentOS7使用firewalld防火墙配置端口
安装启用firewalld防火墙 CentOS7默认的防火墙是firewalld 如果没有firewalld防火墙,可以执行yum install firewalld 命令进行安装 firewalld ...
- Centos7下Firewalld防火墙配置命令
前 言 服务端口日常被拦截,记录一下常用的命令便于查询 Firewalld服务管理 查看防火墙状态 1 systemctl status firewalld 开机启用/禁用防火墙 1 s ...
- CentOS7下Firewall防火墙配置用法详解
官方文档地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide ...
- centos7 开启端口防火墙配置(如开启3306或者80端口)
转载自https://blog.csdn.net/codepen/article/details/52738906 https://www.cnblogs.com/hantianwei/p/57362 ...
- CentOS7使用firewalld防火墙
firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status fir ...
- centos7之firewalld防火墙的配置与使用
firewalld是centos7开始提供的管理防火墙工具,提供了一个动态管理的防火墙,当然低层仍然调用的是 netfilter . 一.区域(zone)firewalld将网卡对应到不同的区域(zo ...
- Centos7 iptables firewalld防火墙与selinux配置
一.iptables防火墙 1.基本操作 # 查看防火墙状态 service iptables status # 停止防火墙 service iptables stop # 启动防火墙 service ...
- CentOS7 firewalld防火墙配置
[root@ecs ~]# firewall-cmd --version //查看版本0.3.9 [root@ecs ~]# firewall-cmd --state //查 ...
- 02.Linux-CentOS系统Firewalld防火墙配置
1.firewalld的基本使用 启动: systemctl start firewalld关闭: systemctl stop firewalld查看状态: systemctl status fir ...
随机推荐
- Django项目同步到码云
本篇博客主要记录下将刚刚初始化后的Django项目部署到码云中,首先我们需要到码云中注册一个账号,下面会讲解下如何在码云中建立一个仓库,再将其克隆到本地.最后将本地的项目推送到码云的仓库中. 码云内初 ...
- nodejs(11)Express 中进行数据库操作
配置 MySql 数据库环境 mysql 第三方模块的介绍和基本配置 要安装操作数据库的第三方包npm i mysql -S 导入 包 const mysql = require('mysql') 创 ...
- ES6 之 Math对象的扩展
1.ES5 http://www.w3school.com.cn/jsref/jsref_obj_math.asp 2.ES6 Math.trunc() - 取整,去掉一个数的小数部分 console ...
- C/C++学习笔记-gcc动态库及静态库
gcc工作流程 1.预处理 gcc -E 2.编译 gcc -S 3.汇编 gcc -c 4.链接 没参数制作静态库: 1.命名规则:libMyName.a2.制作步骤: ①.生成.o gcc -c ...
- 1月18日 LCA专项训练
A. Lorenzo Von Matterhorn B.Minimum spanning tree for each edge C.Misha, Grisha and Underground D.Fo ...
- A - Period(kmp的next数组的应用)
For each prefix of a given string S with N characters (each character has an ASCII code between 97 a ...
- qt使用了qstackedwidget里面放置了widget后对该子widget设置的样式无效
关键字:子窗口样式无效 QStackedwidget 问题: 我有一个对话框,里面放了一个qstackedwidget,qstackedwidget放了N个子窗口,使用addwidget添加上去了: ...
- 奔跑的绵羊js
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 修改Oracle数据库的字符集
2019年6月,来到了新的环境工作,接触了新的项目. 新的项目需要用Oracle数据库,虽然以前没用过,但是边学边用呗,在安装Oracle数据库的时候完全没有注意到要选择UTF-8的字符集,直接就默认 ...
- h5-动画小案例-滚动展示
1.html区域 <div> <ul> <li><img src="../img/a.jpg" alt="">& ...