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

推荐订阅源

The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
WordPress大学
WordPress大学
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
P
Proofpoint News Feed
D
DataBreaches.Net

运维开发绿皮书

OBS虚拟摄像头重命名 Ubuntu备份为LiveOS 使用Powershell卸载windows默认程序 Cisco路由器OSPF配置 汽车的分类和特点 Windows11跳过TPM2.0 HTTPS 双向认证与 USB 加密锁配置实战 SSL 证书工具 字数统计 BMI 计算 颜色转换 Hash 生成器 JSON 格式化 JWT 解码 房贷计算 时间戳转换 URL 编码 UUID 生成 牛马时钟 二维码批量生成器 CKS Simulator Kubernetes 1.25 FRP TOTP验证码生成器 direct-ssh-passthrough-nat 脚本使用说明 Python软件授权 Linux命令行百度网盘 为 Containerd 配置 Harbor 无证书镜像站 Docker一键部署Meta和MetacubexD面板 必应搜索屏蔽垃圾网站 VMware的ubuntu完整安装vm-tools支持粘贴板
使用iptables禁止特定子网访问指定端口
Paper-Dragon · 2025-08-28 · via 运维开发绿皮书

使用iptables禁止特定子网访问指定端口

目的

禁止来自 192.168.12.0/24 子网的设备通过 TCP 协议访问本机的 80、443 和 22 端口。

步骤

# 禁止 192.168.12.0/24 子网通过 TCP 协议访问本机的 80、443 和 22 端口
# 或者 iptables -A INPUT -s 192.168.12.0/24 -p tcp -m multiport --dports 80,443,22 -j REJECT --reject-with icmp-port-unreachable
iptables -t filter -A INPUT -s 192.168.12.0/24 -p tcp --dport 80 -j DROP
iptables -t filter -A INPUT -s 192.168.12.0/24 -p tcp --dport 443 -j DROP
iptables -t filter -A INPUT -s 192.168.12.0/24 -p tcp --dport 22 -j DROP

更新日志

  • 92ac7-使用iptables禁止特定子网访问指定端口