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               #设置防火墙开机启动

最新文章

  1. python成长之路 :线程、进程和协程
  2. 【JAVA】Quartz中时间表达式的设置
  3. Auto CAD 2013的故障解决方法
  4. [转帖]迅为4412开发板最小linux系统的存储空间修改
  5. udp内网穿透 两个内网互联
  6. Java Base64编码解码实现
  7. http概述
  8. html5 标签
  9. Raft、Zab
  10. SQLite批量插入,修改数据库 zt
  11. java的动态绑定与双分派(规避instanceof)
  12. JavaScripts学习日记——DOM SAX JAXP DEMO4J XPath
  13. php采集文章中的图片获取替换到本地
  14. 【前端童鞋看过来!】给大家分享网盘里前端相关书籍,主要是和网络通信(HTTP/TCP/IP)及javascript相关的
  15. Servlet实现简单的登录页面
  16. shell 编程之 if...else case...esac
  17. 第二十天 模块 sys os os下path settings random shuit
  18. Codeforces 1076D Edge Deletion(最短路树)
  19. LODOP打印控件关联输出各内容
  20. 添加网络ADB的方法(含以太网和无线)

热门文章

  1. 怎样理解script标签的defer属性和async属性
  2. android 自动化测试案例之 MonkeyScript
  3. solr 配置中文分析器/定义业务域/配置DataImport功能(测试用)
  4. http协议与soap协议之间的区别
  5. 配置Hadoop,hive,spark,hbase ————待整理
  6. Python之定义默认参数
  7. Computer Vision_33_SIFT:SAR-SIFT: A SIFT-LIKE ALGORITHM FOR SAR IMAGES——2015
  8. LeetCode--字符串
  9. APP微信登录 服务器处理代码
  10. 记录一下关于DQN的想法