Linux学习之iptables过滤规则的使用

cat /etc/redhat-release看到操作系统是CentOS Linux release 7.6.1810uname -r看到内核版本是3.10.0-957.el7.x86_64iptables --version可以看到iptables版本是v1.4.21
在这里插入图片描述

iptables -t filter -A INPUT -s 10.0.0.8 -j ACCEPT会在最后一行插入。
在这里插入图片描述
10.0.0.610.0.0.710.0.0.510.0.0.8没有匹配上的话,默认就是ACCEPT
在这里插入图片描述

iptables -P INPUT DROP可以更改默认规则为DROP,要是云主机的话,不要执行这条语句,否则的话就会连接不上了。

iptables -t filter -D INPUT 1可以删除第一条filterINPUT链的过滤。
在这里插入图片描述

此文章为8月Day 18学习笔记,内容来源于极客时间《Linux 实战技能 100 讲》

猜你喜欢

转载自blog.csdn.net/qq_42108074/article/details/132308386