CentOS7 防火墙firewalld 和 CentOS6 防火墙iptables 开放zabbix-agent端口的方法
我们在生产环境中,一般都是把防火墙打开的,不像测试环境,可以直接关闭掉。最近安装zabbix ,由于公司服务器既有centos 7又有centos 6,遇到了一些防火墙的问题,现在正好把centos防火墙的问题梳理一下,做一个记录。
开放其他端口同理,只需要把我这里的10050修改为其他需要开放的端口即可。
一、CentOS 7 如果打开了防火墙,需要在firewalld中添加策略,允许访问zabbix-agent端口10050和10051
以下是添加zabbix端口10050和10051端口的命令
[root@localhost~]# firewall-cmd --zone=public --add-port=10050/tcp --permanent
[root@localhost~]# firewall-cmd --zone=public --add-port=10050/udp --permanent
[root@localhost~]# firewall-cmd --zone=public --add-port=10051/tcp --permanent
[root@localhost~]# firewall-cmd --zone=public --add-port=10051/udp --permanent
[root@localhost~]# systemctl restart firewalld
添加后可以在 /etc/firewalld/zones/public.xml这个文件中查看是否添加成功
[root@localhost ~]# vim /etc/firewalld/zones/public.xml
二、CentOS 6 如果打开了防火墙,需要在iptables中添加策略,允许访问zabbix-agent端口10050和10051
编辑iptables,添加以下2行
[root@localhost ~]# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10050:10051 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 10050:10051 -j ACCEPT
[root@localhost ~]# /etc/init.d/iptables restart
CentOS7 防火墙firewalld 和 CentOS6 防火墙iptables 开放zabbix-agent端口的方法的更多相关文章
- CentOS7防火墙firewalld 和 CentOS6防火墙iptables的一些配置命令
CentOS7 防火墙 一.防火墙的开启.关闭.禁用.查看状态命令 (1)启动防火墙:systemctl start firewalld (2)关闭防火墙:systemctl stop firewal ...
- CentOS7使用firewalld打开关闭防火墙与端口(转载)
1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disabl ...
- 关于学习CentOS7使用firewalld打开关闭防火墙和端口
1.firewalld简介 firewalld是centos7的一大特点,主要有两个优点:一是支持动态更新,不需要重启服务:二就是加入了防火墙的“zone”概念. firewalld有图形界面和工具界 ...
- CentOS7使用firewalld打开关闭防火墙与端口(转)
CentOS7使用firewalld打开关闭防火墙与端口 1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop ...
- 第一篇:动态防火墙firewalld和静态防火墙iptables
动态防火墙firewalld firewalld提供了一个动态管理的防火墙,它支持网络(network)/防火墙区域(firewall zones )来定义网络连接( network connecti ...
- 转 CentOS7使用firewalld打开关闭防火墙与端口
http://blog.csdn.net/huxu981598436/article/details/54864260 开启端口命令 输入firewall-cmd --query-port=6379/ ...
- CentOS7使用firewalld打开关闭防火墙与端口
1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disab ...
- CentOS7 使用firewalld打开关闭防火墙与端口
1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...
- CentOS7 使用firewalld打开关闭防火墙以及端口
1.firewalld的基本使用 启动 systemctl start firewalld 关闭 systemctl stop firewalld 查看状态 systemctl status fire ...
随机推荐
- 【Matlab】快速傅里叶变换/ FFT/ fftshift/ fftshift(fft(fftshift(s)))
[自我理解] fft:可以指定点数的快速傅里叶变换 fftshift:将零频点移到频谱的中间 用法: Y=fftshift(X) Y=fftshift(X,dim) 描述:fftshift移动零频点到 ...
- 拉格朗日乘子法(Lagrange Multiplier) 和KKT条件
参考文献:https://www.cnblogs.com/sddai/p/5728195.html 在求解最优化问题中,拉格朗日乘子法(Lagrange Multiplier)和KKT(Karush ...
- Java分层思想
从最常规的分层结构来说,系统层次从上到下依次为: 表现层/UI层/界面层:主要是客户端的展示. 服务层/业务层:直接为客户端提供的服务或功能.也是系统所能对外提供的功能. 领域层:系统内的领域活动. ...
- rpm-build方式制作rpm包
目录 一.简介 二.具体操作 一.简介 可以将编译完成的服务打成rpm包放到私有仓库了,用于自定义的各种软件进行安装部署配置. 二.具体操作 1.安装软件,这个命令将构建rpm包 yum -y ins ...
- 搭建直接通过CPU执行汇编语言的环境
搭建直接通过CPU执行汇编语言环境 我们通过编译写好的汇编语言代码可以生成.bin的机器语言二进制代码.但是这个.bin程序我们该如何运行呢? 这里其实有两个办法: 1: 将其作为一个Windows/ ...
- 2、动态规划接替套路框架——Go语言版
前情提示:Go语言学习者.本文参考https://labuladong.gitee.io/algo,代码自己参考抒写,若有不妥之处,感谢指正 关于golang算法文章,为了便于下载和整理,都已开源放在 ...
- js Uncaught TypeError: undefined is not a function
如下代码: var columns={}; var column={}: column.name='张三'; columns.push(column); 会出现Uncaught TypeError: ...
- ThreadLocal的正确使用与原理
ThreadLocal是什么 ThreadLocal是线程Thread中属性threadLocals即ThreadLocal.ThreadLocalMap的管理者,ThreadLocal用于给每个线程 ...
- Elasticsearch 和 solr 的区别
背景:它们都是基于Luence搜索服务器基础之上开发的一款优秀高性能的企业级搜索服务器.也都是基于分词技术构建的倒排索引的方式进行查询 开发语言:java 诞生时间: solr :2004年 es ...
- JAVA导入(读取)Excel中的数据(支持xls与xlsx文件)
一.导入jar包 poi-3.7.jarpoi-scratchpad-3.7.jarpoi-examples-3.7.jarpoi-ooxml-3.7.jarpoi-ooxml-schemas-3.7 ...