Linux之防火墙【CentOS 7】
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Linux之防火墙【CentOS 7】,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1117字,纯文字阅读大概需要2分钟。
内容图文
![Linux之防火墙【CentOS 7】](/upload/InfoBanner/zyjiaocheng/942/c4449cda2702468488cc68021428a2e4.jpg)
CentOS 7默认使用的是firewall作为防火墙,这里改为iptables防火墙。
firewall操作:
# service firewalld status; #查看防火墙状态
(disabled 表明 已经禁止开启启动 enable 表示开机自启,inactive 表示防火墙关闭状态 activated(running)表示为开启状态)
# service firewalld start; 或者 #systemctl start firewalld.service; #开启防火墙
# service firewalld stop; 或者 #systemctl stop firewalld.service; #关闭防火墙
# service firewalld restart; 或者 #systemctl restart firewalld.service; #重启防火墙
# systemctl disable firewalld.service #禁止防火墙开启自启
# systemctl enable firewalld #设置防火墙开机启动
#yum remove firewalld #卸载firewall
安装iptables防火墙及操作:
#yum install iptables-services #安装iptables防火墙
#vi /etc/sysconfig/iptables #编辑防火墙配置文件,开放3306端口
添加配置:-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
#systemctl restart iptables.service #最后重启防火墙使配置生效
#systemctl enable iptables.service #设置防火墙开机启动
转载于:https://www.cnblogs.com/songzhixue/p/11099840.html
内容总结
以上是互联网集市为您收集整理的Linux之防火墙【CentOS 7】全部内容,希望文章能够帮你解决Linux之防火墙【CentOS 7】所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。