Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipvs常用命令 #75

Open
helios741 opened this issue Jan 13, 2020 · 1 comment
Open

ipvs常用命令 #75

helios741 opened this issue Jan 13, 2020 · 1 comment

Comments

@helios741
Copy link
Owner

@helios741
Copy link
Owner Author

helios741 commented Jan 13, 2020

ipset的使用

利用 ipset 封禁大量 IP

1. 简单流程:

ipset create vader hash:ip
iptables -I INPUT -m set --match-set vader src -j DROP
ipset add vader 4.5.6.7
ipset add vader 1.2.3.4
ipset add vader ...
ipset list vader # 查看 vader 集合的内容

2. 常用的命令

ipset del yoda x.x.x.x    # 从 yoda 集合中删除内容
ipset list yoda           # 查看 yoda 集合内容
ipset list                # 查看所有集合的内容
ipset flush yoda          # 清空 yoda 集合
ipset flush               # 清空所有集合
ipset destroy yoda        # 销毁 yoda 集合
ipset destroy             # 销毁所有集合
ipset save yoda           # 输出 yoda 集合内容到标准输出
ipset save                # 输出所有集合内容到标准输出
ipset restore             # 根据输入内容恢复集合内容

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant