centos7下 开启/关闭/查看firewall运行状态命令

1.开启防火墙:systemctl start firewalld.service

[root@localhost bin]# systemctl start firewalld.service
[root@localhost bin]#

2.查看状态:firewall-cmd --state 开启状态:running 关闭状态:not running

[root@localhost bin]# firewall-cmd --state
running

3.关闭防火墙:systemctl stop firewalld.service

[root@localhost bin]# systemctl stop firewalld.service
[root@localhost bin]# firewall-cmd --state
not running

4.开机不启动防火墙:systemctl disable firewalld.service

[root@localhost bin]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@localhost bin]# 
posted @   酸牛奶  阅读(1908)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示