Linux之防火墙【CentOS 7】
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 #设置防火墙开机启动
最新文章
- python成长之路 :线程、进程和协程
- 【JAVA】Quartz中时间表达式的设置
- Auto CAD 2013的故障解决方法
- [转帖]迅为4412开发板最小linux系统的存储空间修改
- udp内网穿透 两个内网互联
- Java Base64编码解码实现
- http概述
- html5 标签
- Raft、Zab
- SQLite批量插入,修改数据库 zt
- java的动态绑定与双分派(规避instanceof)
- JavaScripts学习日记——DOM SAX JAXP DEMO4J XPath
- php采集文章中的图片获取替换到本地
- 【前端童鞋看过来!】给大家分享网盘里前端相关书籍,主要是和网络通信(HTTP/TCP/IP)及javascript相关的
- Servlet实现简单的登录页面
- shell 编程之 if...else case...esac
- 第二十天 模块 sys os os下path settings random shuit
- Codeforces 1076D Edge Deletion(最短路树)
- LODOP打印控件关联输出各内容
- 添加网络ADB的方法(含以太网和无线)
热门文章
- 怎样理解script标签的defer属性和async属性
- android 自动化测试案例之 MonkeyScript
- solr 配置中文分析器/定义业务域/配置DataImport功能(测试用)
- http协议与soap协议之间的区别
- 配置Hadoop,hive,spark,hbase ————待整理
- Python之定义默认参数
- Computer Vision_33_SIFT:SAR-SIFT: A SIFT-LIKE ALGORITHM FOR SAR IMAGES——2015
- LeetCode--字符串
- APP微信登录 服务器处理代码
- 记录一下关于DQN的想法