centos7永久防火墙关闭_centos7关闭防火墙命令
centos7关闭防火墙命令?centos7是一款免费的开源系统,在centos7时代防火墙已由iptable转向firealld,很多小伙伴们就不知道命令是什么了,也不知道如何关闭开启防火墙,那么今天我就为大家带来了centos7关闭防火墙命令以及centos7永久防火墙关闭全部内容。
centos7关闭防火墙命令
1、有些人安装的linux的系统默认防火墙不是iptables,而是fireall,那就得使用以下方式关闭防火墙了。
>>>关闭防火墙
systemctl s firealld.service #停止fireall
systemctl disable firealld.service #禁止fireall开机启动
>>>开启端口
fireall-cmd --zone=public --add-port=80/tcp --permanent
命令含义
--zone #作用域
--add-port=80/tcp #添加端口,格式为端口/通讯协议
--permanent #永久生效,没有此参数重启后失效
>>>重启防火墙
fireall-cmd --reload
其他常用命令
fireall-cmd --state ##查看防火墙状态,是否是running
fireall-cmd --reload ##重新载入配置,比如添加规则之后,需要执行此命令
fireall-cmd --get-zones ##列出支持的zone
fireall-cmd --get-services ##列出支持的服务,在列表中的服务是放行的
fireall-cmd --query-service ftp ##查看ftp服务是否支持,返回yes或者no
fireall-cmd --add-service=ftp ##临时开放ftp服务
fireall-cmd --add-service=ftp --permanent ##永久开放ftp服务
fireall-cmd --remove-service=ftp --permanent ##永久移除ftp服务
fireall-cmd --add-port=80/tcp --permanent ##永久添加80端口
iptables -L -n ##查看规则,这个命令是和iptables的相同的
man fireall-cmd ##查看帮助
更多命令,使用 fireall-cmd --help 查看帮助文件
2、 CentOS 7.0默认使用的是fireall作为防火墙,使用iptables必须重新设置一下
>>>直接关闭防火墙
systemctl s firealld.service #停止fireall
systemctl disable firealld.service #禁止fireall开机启动
>>>设置 iptables service
yum -y install iptables-services
如果要修改防火墙配置,如增加防火墙端口3306
vi /etc/sysconfig/iptables
增加规则
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
保存退出后
systemctl restart iptables.service #重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
办公软件
- 雅安市洗衣机维修-雅安市洗衣机维修电话
- 维修集成灶松溪_集成灶维修服务热线
- 贾汪滚筒洗衣机维修-滚筒洗衣机维修热线电话
- 天门集成灶维修师傅电话,集成灶维修电话附近
- 长治空气源热水器维修_长治空气源热水器维修电
- 瓦房店集成灶维修全过程_瓦房店集成灶维修全过
- 晋江热水器各市区售后400服务电话(总部报修客
- 张家港电视维修-张家港电视维修电话号码
- 芜湖洗衣机24小时服务热线—(7X24小时)登记报
- 鸠江区洗衣机维修-芜湖市洗衣机维修点
- 乌鲁木齐中央空调400售后客服-乌鲁木齐中央空调
- 天水空调维修(天水空调遥控器维修)
- 昆山维修洗衣机-昆山维修洗衣机电话号码
- 宜兴燃气壁挂炉调试EA故障(宜兴壁挂炉E1636多少钱
- 世博莱特空调全国统一售后电话-官方热线400售后
- 天长市区LAMBORGHINI 长春基尼壁挂炉客服电话-厂家