CentOS7打开、关闭端口[通俗易懂]
大家好,又见面了,我是你们的朋友全栈君。
CentOS7使用的是firewall防火墙,不再是原来的iptables
1:查看firewall防火墙状态
firewall-cmd –state
或者
systemctl status firewalld
2:打开防火墙
systemctl start firewalld
3:关闭防火墙
systemctl stop firewalld
4:重启防火墙
firewall-cmd –relaod
或者
systemctl reload firewalld
5:开机自启动防火墙
systemctl enable firewalld
6:禁止开机启动防火墙
systemctl disable firewalld
6:查看已打开的端口
firewall-cmd –list-ports
7:打开端口
firewall-cmd –permanent –zone=public –add-port=8080/tcp
其中permanent表示永久生效,public表示作用域,8080/tcp表示端口和类型
8:关闭端口
firewall-cmd –permanent –zone=public –remove-port=8080/tcp
9:防火墙重载
添加端口或者删除端口之后用这个命令重载才会生效
firewall-cmd –reload
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/162296.html原文链接:https://javaforall.cn
相关文章
- CentOS7配置Apache多站点VirtualHost
- 最小化安装Centos7后安装图形界面[通俗易懂]
- Centos7 网络配置 设置静态Ip
- centos7 安装mysql详细流程
- RabbitMQ & CentOS7
- centos7 安装 nginx[通俗易懂]
- Centos7配置MySQL读写分离[通俗易懂]
- centos7安装yum[通俗易懂]
- centos7 apache 安装配置步骤[通俗易懂]
- centos7 command not found_centos7 failed to start LSB
- CentOS7系统初始配置
- Linux编译安装Python3.9——以CentOS7为例
- Centos7下Frp服务端后台运行以及开机自启(Frp客户端同理)
- centos7 mysqlclient ERROR: Command errored out with exit status 1: python setup.py egg_info Check th
- centos7 minikube 安装问题记录
- CentOS7-查询可以远程登录的帐号信息
- 安装部署:centos7安装部署gitlab服务器的方法
- centos7上修改lv逻辑卷的大小详解程序员
- 基于centos7快速安装mysql5.7教程解析
- 从Centos7升级到Centos8的教程(图文详解)
- Centos7下Samba服务器配置(实战)
- CentOS7安装Python3.7详解编程语言