2.软文推荐
3.软文推荐
目录: 1、CentOS-7.5 使用 iptables 2、centos 安装iptables和iptables-services 3、CentOS 7 下使用iptables CentOS-7.5 使用 iptables1、关闭 firewalld
由于 firewalld 是 CentOS-7系列的默认防火墙,因此如果想使用iptables的话,需要将CentOS-7系列的默认防火墙 firewalld 关闭,并安装 iptables-services
[root@shell ~]#
[root@shell ~]# systemctl stop firewalld.service #关闭
[root@shell ~]# systemctl disable firewalld.service #禁止开机自启动
[root@shell ~]# firewall-cmd --state #查看firewalld是否在运行
not running
[root@shell ~]#
2、安装iptables防火墙
[root@shell ~]#
[root@shell ~]# yum install iptables-services #安装iptables服务
[root@shell ~]# systemctl start iptables
[root@shell ~]# systemctl enable iptables #设置iptables为开机自启动
[root@shell ~]#
[root@shell ~]# cat /etc/sysconfig/iptables #查看iptables默认配置
[root@shell ~]#
[root@shell ~]#
[root@shell ~]# systemctl start iptables #启动 iptables
[root@shell ~]# systemctl status iptables #查看状态
[root@shell ~]#
[root@shell ~]# iptables -L #查看当前防火墙规则
3、配置防火墙规则
centos 安装iptables和iptables-services查看当前系统是否安装防火墙
安装 iptables
安装 iptables-services
查看iptables现有规则
防火墙是需要开启80端口,不然外网就不能访问到主机资源。
开启相关规则的命令:
保存配置,并重启:
CentOS 7 下使用iptablesiptables/netfilter(下文中简称为iptables)组成Linux平台下的包过滤防火墙,含有网络地址转换(Network Address Translate)、数据包内容修改以及数据包过滤等功能。
iptables内置了4个表优先级次序(由高而低):raw -- mangle -- nat -- filter
iptables上有5条链
CentOS 7 默认使用firewalld.service,要想切换iptables.service需要安装iptables(默认已经安装了)和iptables-services这两个依赖包

立即
返回
1
目录:1、哪家美国VPS便宜又稳定啊?支持支付宝的VPS主机2、哪款海外 VPS 性价比高3、外贸主机是选择虚拟主机还是vps呢?哪个更好呢?顺便...