firewall-cmd –zone=public –add-port=161/udp –permanentfirewall-cmd –zone=public –add-port=161/tcp –permanentfirewall-cmd –zone=public –add-port=162/udp –permanentfirewall-cmd –zone=public –add-port=162/tcp –permanentfirewall-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 |