CentOS7 防火墙

CentOS7 防火墙

安装firewalld

#安装
yum install firewalld
#启动
systemctl start firewalld

打开端口号

firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --zone=public --add-port=6379/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent

#参数说明
#–zone                        #作用域
#–add-port=80/tcp        #添加端口,格式为:端口/通讯协议
#–permanent                    #永久生效,没有此参数重启后失效

重启防火墙后看看是否生效

firewall-cmd --reload        #重启firewall
firewall-cmd --list-ports    #查看已经开放的端口

永久停止防火墙,执行下面操作

systemctl stop firewalld.service         #停止firewall
systemctl disable firewalld.service      #禁止firewall开机启动

# 查看防火墙状态
firewall-cmd --state        #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

 上一篇
CentOS下zookeeper安装 CentOS下zookeeper安装
CentOS下zookeeper安装解压tar -zxvf zookeeper-3.4.14.tar.gz 修改配置进入zookeeper-3.4.14/conf下复制 zoo_sample.cfg文件 cp conf/zoo_sample
2020-08-08
下一篇 
CentOS7 系统时间处理 CentOS7 系统时间处理
CentOS7 系统时间处理查看系统容时间,硬件时间date //查看系统时间 hwclock //查看硬件时间 timedatectl # 查看系统时间方面的各种状态 Local time: 四 2014-12-2
2020-08-08
  目录