CentOS 7中设置ip白名单
我想安装CentOS 7防火墙,所有传入的请求将被封锁,除了IP白名单。对于白名单的IP的所有端口都要访问?
adding sources to a zone. First checkout which sources there are for your zone:
firewall-cmd --permanent --zone=public --list-sources
If there are none, you can start to add them, this is your "whitelist"
firewall-cmd --permanent --zone=public --add-source=192.168.100.0/24
firewall-cmd --permanent --zone=public --add-source=192.168.222.123/32
(That adds a whole/24and a single IP, just so you have a reference for both a subnet and a single IP)
Set the range of ports you'd like open:
firewall-cmd --permanent --zone=public --add-port=1-22/tcp
firewall-cmd --permanent --zone=public --add-port=1-22/udp
This just does ports 1 through 22. You can widen this, if you'd like.
Now, reload what you've done.
firewall-cmd --reload
And check your work:
firewall-cmd --zone=public --list-all
蚂蚁庄园今日答案最新:在古代以下哪种称呼与医生有关?悬壶还是白士
蚂蚁庄园今日答案最新:在古代以下哪种称呼与医生有关?悬壶还是白士(0)人阅读时间:2023-11-30OpenAI发生严重故障 OpenAI发生严重故障
OpenAI发生严重故障 导致ChatGPT无法使用(0)人阅读时间:2023-11-29蚂蚁庄园今日答案最新:以下哪种形状的柚子口感更好?上尖下宽还是近似球形
蚂蚁庄园今日答案最新:以下哪种形状的柚子口感更好?上尖下宽还是近似球形(0)人阅读时间:2023-11-29“欧几里德”空间望远镜拍摄的首批彩色图像发布
“欧几里德”空间望远镜拍摄的首批彩色图像发布(0)人阅读时间:2023-11-29