当前位置:网站首页>【网络安全】通过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 - 博客园
边栏推荐
- 动态规划问题(四)
- Laravel permission control
- I don't know how lucky the boy who randomly typed the log is. There must be a lot of overtime!
- Api 接口优化有哪些技巧?
- Applet waterfall flow, upload pictures, simple use of maps
- “吃货联盟定餐系统”
- PTA (daily question) 7-69 narcissus number
- Router view cannot be rendered (a very low-level error)
- Camera Hal OEM module ---- CMR_ preview.c
- 还在写大量 if 来判断?一个规则执行器干掉项目中所有的 if 判断...
猜你喜欢

ACM SIGIR 2022 | interpretation of selected papers of meituan technical team

"Method not allowed", 405 problem analysis and solution

17.机器学习系统的设计

vulnhub:BTRSys2
![[micro services ~nacos] Nacos service providers and service consumers](/img/b7/47ecd6979ccfeb270261681d6130be.png)
[micro services ~nacos] Nacos service providers and service consumers

Dynamic programming (V)

Advanced area of attack and defense world web masters unserialize3

【开发教程10】疯壳·开源蓝牙心率防水运动手环-蓝牙 BLE 收发

CV instance segmentation model sketch (1)

Talk about seven ways to realize asynchronous programming
随机推荐
PTA (daily question) 7-77 encryption
"Method not allowed", 405 problem analysis and solution
16.偏差、方差、正则化、学习曲线对模型的影响
IDEA 连接 数据库
Still writing a lot of if to judge? A rule executor kills all if judgments in the project
1331. Array sequence number conversion: simple simulation question
总结:POD与容器的区别
feign调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r
Idea connection database
[micro services ~nacos] Nacos service providers and service consumers
动态规划问题(一)
Kali installs burpsuite professional
Oracle实例无法启动的问题如何解决
Use hutool tool class to operate excel with more empty Sheet1
【开发教程11】疯壳·开源蓝牙心率防水运动手环-整机功能代码讲解
PTA (daily question) 7-71 character trapezoid
Idea error running 'application' command line is too long solution
2022网络安全学习路线 非常详细 推荐学习
Html+css+php+mysql realize registration + login + change password (with complete code)
[ESN] learning echo state network