当前位置:网站首页>【网络安全】通过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 - 博客园
边栏推荐
- R语言怎么学
- MySQL 分库分表及其平滑扩容方案
- Event extraction and documentation (2008-2017)
- Network traffic monitoring tool iftop
- PTA (daily question) 7-72 calculate the cumulative sum
- Dynamic programming problem (3)
- Why is it so difficult for the SEC to refuse the application for transferring gray-scale GBTC to spot ETF? What is the attraction of ETF transfer?
- Geth installation
- @Detailed explanation of the use of transactional annotation
- What are the skills of API interface optimization?
猜你喜欢

15.模型评估和选择问题

Dynamic programming problem (VIII)

PTA (daily question) 7-69 narcissus number

vulnhub:BTRSys2

Event extraction and documentation (2018)

PTA (daily question) 7-77 encryption

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

Immutable x officially opens IMX token pledge detailed IMX pledge introduction optimistic about the development prospect of IMX

IDEA2021.2安装与配置(持续更新)

PTA (one question per day) 7-76 ratio
随机推荐
Okaleido ecological core equity Oka, all in fusion mining mode
[ESN] learning echo state network
Attack and defense world web master advanced area web_ php_ include
16.偏差、方差、正则化、学习曲线对模型的影响
Use hutool tool class to operate excel with more empty Sheet1
Still writing a lot of if to judge? A rule executor kills all if judgments in the project
Oracle超全SQL,细节狂魔
递归/回溯刷题(中)
Attack and defense world web master advanced area php2
IDEA 连接 数据库
PTA (daily question) 7-70 diamond
PTA (daily question) 7-69 narcissus number
Sword finger offer 55 - I. depth of binary tree
Do like and in indexes in MySQL go
手把手教你安装Latex(保姆级教程)
MySQL installation and configuration tutorial (super detailed, nanny level)
Idea2021.2 installation and configuration (continuous update)
Advanced area of attack and defense world web masters supersqli
MySQL transaction (this is enough...)
R语言怎么学