CentOS7.0以上版本linux防火墙问题
来源:互联网 发布:如何做好旅游网络推广 编辑:程序博客网 时间:2024/05/17 14:20
CentOS 7.0默认使用的是firewall作为防火墙,使用iptables来做防火墙,那么必须重新设置一下
1、直接关闭防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、设置 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 #设置防火墙开机启动
最后重启系统使设置生效即可。
shutdown -r now 立刻重启(root用户使用)
查看哪些端口被打开
iptables -nvL
关闭端口号
iptables -A INPUT -p tcp --drop 端口号 -j DROP
iptables -A OUTPUT -p tcp --dport 端口号 -j DROP
打开端口号
iptables -A INPUT -ptcp --dport 端口号 -j ACCEPT
将某些规则的包 log 到/var/log/message中
iptables -I {position} INPUT -J log --prefix "xxx"
- CentOS7.0以上版本linux防火墙问题
- Linux-centos7防火墙问题
- Centos7.0以上版本静态IP设置
- [转]卡巴斯基防火墙与ActiveSync4.0以上版本冲突解决办法
- centos7 防火墙问题
- CENTOS7 防火墙问题
- Linux-centos7防火墙
- Linux (centos7) 防火墙命令
- Linux centos7防火墙配置
- Linux (centos7) 防火墙命令
- Linux (centos7) 防火墙命令
- Linux (centos7) 防火墙命令
- server2008 及其以上版本防火墙设置
- springmvc4.0以上和jackson版本问题
- postgres CENTOS7 上防火墙问题。
- Centos7 Firewalld 解决防火墙问题
- CentOS7.0 关闭防火墙
- CentOS7.0 关闭防火墙
- List,Set,Map是否继承自Collection接口? 答:List,Set是,Map不是。 Collection是最基本的集合接口,一个Collection代表一组Object,即Colle
- 初识linux 中的fork()
- SSH框架入门(2)——struts2(2)
- 对开根号判断素数的优化
- java并发编程-PriorityBlockingQueue
- CentOS7.0以上版本linux防火墙问题
- springboot整合mybatis,动态数据源配置
- eclipse和jdk历史版本下载地址
- 第十章 会话管理(六) sessionFactory
- ionic运行问题
- CentOS下JDK 1.8的安装
- ArrayList、Vector、LinkedList的区别及其优缺点?
- C语言——关机小程序
- 面向对象思想