惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
Intezer
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
N
News | PayPal Newsroom
T
Tenable Blog
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
P
Privacy International News Feed
IT之家
IT之家
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
博客园_首页
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
NISL@THU
NISL@THU
I
InfoQ
D
DataBreaches.Net
有赞技术团队
有赞技术团队
K
Kaspersky official blog
Security Latest
Security Latest
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AI
AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic

基础 on 打工人日志

Tmux 安装和使用教程 使用 ElasticSearch Curator 7天定期删除日志 GNU/Linux 一键更换系统软件源脚本 在windows上安装appium 可观测性和监控的区别 基础知识-计算机系统 systemd 守护命令 Linux crontab 命令 linux常用命令 linux基础知识 yaml 语法 网络基础知识 linux服务基础知识 mysql基础知识 shell基础知识 TCP/IP详解 运维知识图谱
iptables 基础知识
2021-12-27 · via 基础 on 打工人日志

iptables 基础知识

内核包过滤与 NAT 管理工具.是 linux 系统中在用户空间中运行的运来配置内核防火墙的工具。它可以设置,维护和检查 linux 内核中的 ipv4 包过滤规则和管理网络地址转换(NAT)。
ipatbles 命令仅支持 ipv4,如果使用的 IP 协议是 ipv6 则需要使用专门的管理工具 ip6tables。

常用参数

参数作用
-t<表>指定要操纵的表
-A向规则链中追加条目
-D从规则链中删除条目
-I向规则链中插入条目
-R替换规则链中的相应条目
-L显示规则链中的已有条目
-F清除规则链中的现有条目。不改变规则链的默认目标策略
-Z清空规则链中的数据包计数器和字节计数器
-N创建新的用户自定义规则链
-P定义规则链中的默认目标(策略)
-h显示帮助信息
-p<协议>指定要匹配的数据包的协议类型
-s<源地址>指定要匹配的数据包的源 IP 地址
-j<目标>指定要跳转的目标
-i<网络接口>指定数据包进入本机的网络接口
-o<网络接口>指定数据包离开本机做使用的网络接口
-c<包计数>在执行插入、追加和替换操作时初始化包计数器和字节计数器

参考实例

显示内核当前的 filter 表:

显示内核当前的 nat 表:

禁止本机对 192.168.20.20 地址的访问:

1iptables -t filter -A OUTPUT -d 192.168.20.20 -j DROP

显示 filter 表的 OUTPUT 链:

1iptables -L OUTPUT -t filter