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

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

Rat's Blog - iptables

使用ipset设置防火墙端口白名单,只让指定国家访问 - Rat's Blog Linux VPS使用ipset快速屏蔽指定国家的IP访问 - Rat's Blog iptables封禁BT/PT/SPAM(垃圾邮件)和自定义端口/关键词一键脚本 - Rat's Blog CentOS 7使用iptables开放设置端口 - Rat's Blog 使用iptables封掉所有邮件端口 - Rat's Blog 使用iptables进行端口转发 - Rat's Blog Linux使用iptables封IP或IP段教程 - Rat's Blog iptables之禁ping和ddos向外发包 - Rat's Blog
Linux VPS一键屏蔽指定国家所有的IP访问 - Rat's Blog
博主: Rat's · 2018-05-14 · via Rat's Blog - iptables

说明:对于屏蔽指定国家所有的IP的手动教程已经讲了,查看:Linux VPS使用ipset快速屏蔽指定国家的IP访问,虽然步骤很简单,但为了更白的小白,博主写了个一键脚本,这里分享下。

提示:据一些同学需求,博主也发了个白名单教程,查看:使用ipset设置防火墙端口白名单,只让指定国家访问

使用

本脚本适用于CentOSDebianUbuntu等常用系统。

使用root运行以下命令:

wget https://www.moerats.com/usr/shell/block-ips.sh
chmod +x block-ips.sh
./block-ips.sh

封禁ip时会要求你输入国家代码,代码查看:点击进入。记住所填参数均为小写字母。比如JAPAN (JP),我们就输入jp这个参数。

演示

1、封禁IP
请输入图片描述

2、查看封禁列表
请输入图片描述

3、解封IP
请输入图片描述

总结

一键屏蔽可以有效帮我们暂时防止一些CC攻击等,或者你不想让哪国的人进入博客也可以用,注意屏蔽cn的时候需谨慎,不然你SSH就上不去了。


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/585/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。