CentOS 7以上默认使用firewall作为防火墙改为iptables
来源:互联网 发布:画画的软件手机 编辑:程序博客网 时间:2024/06/05 03:52
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
2、iptables防火墙(这里iptables已经安装,下面进行配置)
vi/etc/sysconfig/iptables #编辑防火墙配置文件
# sampleconfiguration for iptables service
# you can edit thismanually or use system-config-firewall
# please do not askus to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT[0:0]
:OUTPUT ACCEPT[0:0]
-A INPUT -m state--state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -jACCEPT
-A INPUT -i lo -jACCEPT
-A INPUT -p tcp -mstate --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -jACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080-j ACCEPT
-A INPUT -j REJECT--reject-with icmp-host-prohibited
-A FORWARD -jREJECT --reject-with icmp-host-prohibited
COMMIT
:wq! #保存退出
备注:这里使用80和8080端口为例。***部分一般添加到“-A INPUT -p tcp -m state --state NEW -m tcp--dport 22 -j ACCEPT”行的上面或者下面,切记不要添加到最后一行,否则防火墙重启后不生效。
systemctlrestart iptables.service #最后重启防火墙使配置生效
systemctlenable iptables.service #设置防火墙开机启动
- CentOS 7以上默认使用firewall作为防火墙改为iptables
- CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙,配置apache
- CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。
- CentOS 7.0默认使用的是firewall作为防火墙
- CentOS 7.0默认使用的是firewall作为防火墙。
- CentOS 7.0默认使用的是firewall作为防火墙。
- CentOS 7 关闭防火墙(firewall)并安装iptables防火墙
- centos 7 防火墙设置 使用 iptables firewall-cmd 开放端口号
- CentOS 7 改用iptables作为防火墙
- CentOS 7 防火墙 firewall
- CentOS 7 使用iptables防火墙
- 云服务器 ECS CentOS 7配置默认防火墙 Firewall
- 云服务器 ECS CentOS 7配置默认防火墙 Firewall
- CentOS 7关闭默认防火墙启用iptables防火墙
- CentOS 7中firewall防火墙详解和配置以及切换为iptables防火墙
- CentOS 7中firewall防火墙详解和配置以及切换为iptables防火墙
- CentOS 7中firewall防火墙详解和配置以及切换为iptables防火墙
- Centos 7 防火墙firewall配置
- http你不得不知道的那些事(三)-XHR
- [cnblogs镜像]Mac 查看 剪贴板/剪切板/粘贴板 内容与格式
- 颜色对照表
- Socket编程2-UDP协议
- vmware设置共享目录
- CentOS 7以上默认使用firewall作为防火墙改为iptables
- 卷积神经网络细节上的问题总结
- VUE2.0仿UC浏览器奇趣百科一款以幽默,图片,视频深受年轻人喜爱的webAPP
- vue.js实现点击事件
- JS实现队结构及利用队列模拟‘击鼓传花’游戏
- 基于liunx的版本管理工具介绍—Git篇
- 用rem为单位写自适应的页面
- [cnblogs镜像]macOS 不用任何第三方工具 简单两步使用 Automator 将截图转成@1x
- NKOJ P2507 河城荷取