当前位置:网站首页>【网络安全】通过iptables和ipset完成服务器防火墙黑名单和白名单功能
【网络安全】通过iptables和ipset完成服务器防火墙黑名单和白名单功能
2022-07-28 22:37:00 【没枕头我咋睡觉】
1、命令安装
yum install ipset
yum install iptables
2、通过ipset创建黑白名单
ipset create whitelist hash:net
ipset create blacklist hash:net
3、通过iptables开启黑白名单
> 开启黑白名单
iptables -P INPUT DROP
iptables -A INPUT -m set --match-set whitelist src -j ACCEPT
> 开启黑名单
iptables -P INPUT ACCEPT
iptables -A INPUT -m set --match-set blacklist src -j DROP
参考链接:ipset命令的介绍与使用:Centos7 ipset命令介绍及使用 - 人艰不拆_zmc - 博客园
边栏推荐
- 110道 MySQL面试题及答案 (持续更新)
- 2022 network security learning route is very detailed, recommended Learning
- CV instance segmentation model sketch (1)
- Network traffic monitoring tool iftop
- MySQL stored procedure
- What are the skills of API interface optimization?
- PHP语言基础知识(超详细)
- Everything you have learned will come in handy at some point in your life (turn)
- Dynamic programming problem (6)
- [CNN] Why is the convolution kernel size of CNN usually odd
猜你喜欢

What are the skills of API interface optimization?

Router view cannot be rendered (a very low-level error)

2022dasctfjuly empowerment competition (reappearance)

Software designer afternoon question

Basic knowledge of PHP language (super detailed)

PTA (one question per day) 7-76 ratio
![[CNN] Why is the convolution kernel size of CNN usually odd](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[CNN] Why is the convolution kernel size of CNN usually odd

Oracle实例无法启动的问题如何解决

Advanced area of attack and defense world web masters -baby Web

The difference between {} and ${}
随机推荐
Alibaba code index technology practice: provide reading experience of local IDE for code review
What does the expression > > 0 in JS mean
Do like and in indexes in MySQL go
软考 --- 数据库(4)SQL语句
PTA (daily question) 7-75 how many people in a school
Installation and use of pnpm
Dynamic programming problem (6)
Cause analysis of 12 MySQL slow queries
Advanced area of attack and defense world web masters warmup
Basic knowledge of PHP language (super detailed)
Sword finger offer 64. find 1+2+... +n, logical operator short circuit effect
2022DASCTF7月赋能赛(复现)
动态规划问题(四)
2022 network security learning route is very detailed, recommended Learning
Introduction and solution of common security vulnerabilities in web system CSRF attack
MySQL事务(transaction) (有这篇就足够了..)
Linux下安装Mysql5.7,超详细完整教程,以及云mysql连接
12个MySQL慢查询的原因分析
Sword finger offer 41. median in data flow
110道 MySQL面试题及答案 (持续更新)