博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
centos7防火墙设置
阅读量:6937 次
发布时间:2019-06-27

本文共 664 字,大约阅读时间需要 2 分钟。

1.使用命令 firewall-cmd --state查看防火墙状态。得到结果是running或者not running
2.在running 状态下,向firewall 添加需要开放的端口
命令为 firewall-cmd --permanent --zone=public --add-port=80/tcp
3.firewall-cmd --reload //加载配置,使得修改有效。
4.firewall-cmd --permanent --zone=public --list-ports 查看开启的端口,出现80/tcp这开启正确
 现在就可以访问了
 
开启防火墙的命令
systemctl start firewalld.service
 关闭防火墙的命令
systemctl stop firewalld.service
 开机自动启动
systemctl enable firewalld.service
 关闭开机自动启动
systemctl disable firewalld.service
 查看防火墙状态
systemctl status firewalld
 

删除端口

firewall-cmd --zone=public --remove-port=80/tcp --permanent
firewall-cmd --reload
systemctl restart firewalld.service

转载于:https://www.cnblogs.com/DonCharles/p/9929924.html

你可能感兴趣的文章
修改Tomcat Connector运行模式,优化Tomcat运行性能
查看>>
linux中断申请之request_threaded_irq【转】
查看>>
iOS进阶路线以及进阶书籍
查看>>
开源软件:信息共赢和开放心态
查看>>
Performance Counter的使用——获取各类组件性能,获取CPU参数等
查看>>
Python多线程(2)——线程同步机制
查看>>
学习算法 - 表指针实现~ C++
查看>>
Linking Containers Together
查看>>
storm学习之七-storm UI页面参数详解
查看>>
CodeForces 191C 树链剖分 第4遍
查看>>
Android学习之SQLite学习
查看>>
U - stl 的 优先队列 Ⅰ
查看>>
面对工作怎么才能不浮躁
查看>>
PHP调用Linux的命令行执行文件压缩命令&&创建文件夹修改权限
查看>>
LRU算法&&LeetCode解题报告
查看>>
不需要重启就能挂载磁盘的方法,还不快来Get
查看>>
Android多媒体之GL-ES战记第二集--谜团立方
查看>>
诚意之作,SuperTextView (v3.1.1)
查看>>
如何在 Vue 中优雅地使用 CSS Modules?
查看>>
CSS图片赋色技术研究
查看>>