GalaxyData Community

How to Allow SNMP ports in FirewallD CentOS 7

firewall-cmd --zone=public --add-port=161/udp --permanent
firewall-cmd --zone=public --add-port=161/tcp --permanent
firewall-cmd --zone=public --add-port=162/udp --permanent
firewall-cmd --zone=public --add-port=162/tcp --permanent
firewall-cmd --reload

or add XML

nano /etc/firewalld/services/snmp.xml

ADD file

<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>SNMP</short>
  <description>SNMP protocol</description>
  <port protocol="udp" port="161"/>
  <port protocol="tcp" port="161"/>
</service>

 

firewall-cmd --zone=public --add-service snmp --permanent
firewall-cmd --reload

 

Exit mobile version