linux-防火墙
2022/8/31 5:22:58
本文主要是介绍linux-防火墙,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
防火墙常用命令
安装Firewall命令:
yum install firewalld firewalld-config
Firewall开启常见端口命令:
firewall-cmd –zone=public –add-port=80/tcp –permanent firewall-cmd –zone=public –add-port=443/tcp –permanent firewall-cmd –zone=public –add-port=22/tcp –permanent firewall-cmd –zone=public –add-port=21/tcp –permanent firewall-cmd –zone=public –add-port=53/udp –permanent
Firewall关闭常见端口命令
firewall-cmd –zone=public –remove-port=80/tcp –permanent firewall-cmd –zone=public –remove-port=443/tcp –permanent firewall-cmd –zone=public –remove-port=22/tcp –permanent firewall-cmd –zone=public –remove-port=21/tcp –permanent firewall-cmd –zone=public –remove-port=53/udp –permanent
批量添加区间端口
firewall-cmd –zone=public –add-port=4400-4600/udp –permanent firewall-cmd –zone=public –add-port=4400-4600/tcp –permanent
开启防火墙命令:
W
**重启防火墙命令:**
firewall-cmd –reload 或者 service firewalld restart
查看放行端口:
firewall-cmd --list-ports
**禁用防火墙**
systemctl stop firewalld
**设置开机启动**
systemctl enable firewalld
**停止并禁用开机启动**
sytemctl disable firewalld
**查看状态**
systemctl status firewalld或者 firewall-cmd –state
这篇关于linux-防火墙的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-12-18git仓库有更新,jenkins 自动触发拉代码怎么配置的?-icode9专业技术文章分享
- 2024-12-18Jenkins webhook 方式怎么配置指定的分支?-icode9专业技术文章分享
- 2024-12-13Linux C++项目实战入门教程
- 2024-12-13Linux C++编程项目实战入门教程
- 2024-12-11Linux部署Scrapy教程:新手入门指南
- 2024-12-11怎么将在本地创建的 Maven 仓库迁移到 Linux 服务器上?-icode9专业技术文章分享
- 2024-12-10Linux常用命令
- 2024-12-06谁看谁服! Linux 创始人对于进程和线程的理解是…
- 2024-12-04操作系统教程:新手入门及初级技巧详解
- 2024-12-04操作系统入门:新手必学指南