首页 > 其他分享 >添加白名单

添加白名单

时间:2022-11-08 11:14:47浏览次数:61  
标签:-- cmd rule firewall 添加 permanent 白名单 port

参考资料 https://www.cnblogs.com/phpshen/p/5842118.html

查看防火墙状态

systemctl status firewalld

开启防火墙

systemctl start firewalld.service

关闭防火墙

systemctl stop firewalld.service

开机自动启动

systemctl enable firewalld.service

关闭开机制动启动

systemctl disable firewalld.service

开放33066端口,供所有IP访问 (追加到配置文件,需重启防火墙才能生效)

firewall-cmd --zone=public --add-port=33066/tcp --permanent

开放33066端口,供所有IP访问 (立马生效,重启防火墙后丢失)

firewall-cmd --zone=public --add-port=33066/tcp

删除33066开放策略

firewall-cmd --remove-port=3306/tcp --permanent

开放部分端口,供部分IP访问 (永久需重启)

firewall-cmd --add-rich-rule="rule family="ipv4" source address="10.144.97.129" port protocol="tcp" port="30000" accept" --permanent

开放部分端口,供部分IP访问 (临时路由,重启丢失)

firewall-cmd --add-rich-rule="rule family="ipv4" source address="10.144.97.129" port protocol="tcp" port="30000" accept"

开放IP白名单(不限定端口,永久需重启)临时路由去掉--permanent

firewall-cmd --add-rich-rule="rule family="ipv4" source address="10.4.250.95" accept" --permanent

删除

firewall-cmd --remove-rich-rule="rule family="ipv4" source address="10.4.250.144" accept" --permanent

其他

firewall-cmd --add-icmp-block=echo-request --permanent
firewall-cmd --remove-service=ssh --permanent
firewall-cmd --zone=public --remove-port=20010/tcp --permanent

禁止指定的ip访问本机

firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address="10.4.14.240/28" drop'

重新加载防火墙

firewall-cmd --reload

查看防火墙策略

firewall-cmd --list-all

10IP全开

10.0.0.0/8

删除防火墙某条规则

firewall-cmd --permanent --remove-rich-rule 'rule family=ipv4 source address=10.0.0.0/24 port port=20010 protocol=tcp accept'

标签:--,cmd,rule,firewall,添加,permanent,白名单,port
From: https://www.cnblogs.com/leasing/p/16868995.html

相关文章

  • 路由添加之手动
    win系统routeprintrouteadd172.16.0.0MASK255.255.0.011.0.18.1  //临时,重启无效route-padd 172.16.0.0MASK255.255.0.011.0.18.1 //参数p示意永久路......
  • SpringMVC添加依赖包
    `4.0.0<groupId>org.example</groupId><artifactId>ssmbuild</artifactId><version>1.0-SNAPSHOT</version><properties><maven.compiler.source>8</maven.com......
  • Hexo主题next中添加天气插件(心知天气)
    最近想在博客主题中添加一个天气插件,在网上搜索一番以后选择了【心知天气】。实现在博客中预报天气的效果。首先要去心知天气的官网,获取插件代码,具体方式可以参见【官方文......
  • ffmpeg添加实时水印
    这次需要测试直播延时,添加一个实时的时间水印方便对比,命令如下:ffmpeg-isrc.mp4-c:vh264-vfdrawtext=text="%{localtime}":x=100:y=100:fontfile='C\:\\Windows\\fo......
  • go:快速添加接口方法及其实现
    问题描述在大型项目中,通常存在多个模块,模块对外暴露的功能通常是通过接口封装,这样可以明确模块的功能,有效降低模块与模块之间的耦合度,同时模块与模块之间进行合理的组装。......
  • ping添加时间戳
    以下内容直接复制到txt文档,将.txt后缀改成.vbs将vbs文件放到C盘根目录,直接双机打开,运行后C盘根目录下会有以ping的目的地址为文件名的txt文档 Setshell=WScript.Cr......
  • C# 9.0 添加和增强的功能【基础篇】
    C#9.0添加和增强的功能【基础篇】 阅读目录一、记录(record)with表达式二、仅限Init的资源库三、顶级语句四、模式匹配增强功能五、模块初始值设定(Modu......
  • 深度学习添加噪声
    importskimageimportosfromskimageimportioimportrandomdefaddPoissonNoise(s):var=random.uniform(0.01,0.2)origin=skimage.io.imread(s)......
  • el-table添加序号
    参考声明:https://blog.csdn.net/weixin_44261540/article/details/124386986主要的就是加入标签加入额外的内容,感觉没啥好说的看代码应该能明白,记录一下。<el-table-c......
  • axios请求拦在器添加token(请求头添加token)保证有权访问请求数据~~
    axios请求拦在器添加token开发项目中有很多个请求接口,除了login以外其他的请求接口有了访问权限才能正常请求数据访问页面。需要授权的API必须每一次的请求携带token,就......