1.软文推荐

2.软文推荐

3.软文推荐

目录: 1、CentOS-7.5 使用 iptables 2、centos 安装iptables和iptables-services 3、CentOS 7 下使用iptables CentOS-7.5 使用 iptables

1、关闭 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 下使用iptables

iptables/netfilter(下文中简称为iptables)组成Linux平台下的包过滤防火墙,含有网络地址转换(Network Address Translate)、数据包内容修改以及数据包过滤等功能。

iptables内置了4个表优先级次序(由高而低):raw -- mangle -- nat -- filter

iptables上有5条链

CentOS 7 默认使用firewalld.service,要想切换iptables.service需要安装iptables(默认已经安装了)和iptables-services这两个依赖包

相关文章 8

1

外贸vps主机哪个好,美国vps主机哪家的最可靠 35秒前

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

3

win10开机快速启动设置,win10开机快速启动设置在哪 3分钟前

目录:1、win10没logo怎么设置快速启动?2、win10如何设置快速启动3、怎么样让win10开机迅速点4、win10系统怎么设置开机最快5、Win10设置快速启...

4

阿里云1m带宽速度,阿里云10m带宽相当于现实多少兆 3分钟前

目录:1、关于带宽的问题?阿里云2、阿里云带宽峰值怎么选择3、阿里云1m的带宽能满足什么样的访问量关于带宽的问题?阿里云 1M带宽下栽...

5

新加坡vps测评,新加坡vps云服务器 5分钟前

目录:1、香港vps和新加坡vps,大陆访问哪个更快2、阿里云新加坡轻量 网速3、【供】新加坡vps速度怎么样?新加坡国内使用最快速稳定vps服...

6

seo推广优化管用吗,seo是靠什么优化的 7分钟前

目录:1、SEO优化有什么作用吗2、做SEO优化到底有没有效果呢?3、seo有没有用SEO优化有什么作用吗 1、提高网站知名度 随着时代的进步,现...

7

郑州vps主机,国内vps云主机 8分钟前

目录:1、哪里有稳定性最好的vps服务器?2、想换个VPS用,请问哪里比较稳定?3、Server-U哪个版本的好用点啦?VPS主机哪家的实惠些4、VPS主...

8

搜索引擎优化seo服务平台,搜索引擎优化seo服务平台排名 9分钟前

目录:1、搜索引擎优化SEO哪家公司比较专业?2、找哪家网站seo搜索引擎优化排名营销公司可靠?3、有哪些常用的seo排名软件?4、什么是...