Enable Zabbix agent port on Linux client firewall

How to enable Zabbix port on different Linux firewalls. For example our Zabbix server running on  IP : 10.10.0.5, we need to enable Zabbix-agent.d port TCP/10050 on clients:

Iptables

simple iptables:

iptables -A INPUT -s 10.10.0.5/32 -p tcp -m tcp --dport 10050 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 10050 -j DROP

after it you can use iptables-persistent command to save iptables rules during reboot:

iptables-save > /etc/iptables/rules.v4

Ubuntu

sudo ufw allow from 10.10.0.5 proto tcp to any port 10050

RedHat / Centos

firewall-cmd --new-zone=zabbix --permanent
firewall-cmd --permanent --zone=zabbix --add-source=10.10.0.5/32
firewall-cmd --permanent --zone=zabbix --add-port=10050/tcp
firewall-cmd --reload
Tagged with:

Leave a Reply

Your email address will not be published.