sudo apt update && sudo apt upgrade -y
sudo apt-get install snmp snmpd
 
sudo nano /etc/snmp/snmpd.conf

                        #agentAddress udp:161,udp6:[::1]:161
                        agentAddress udp:161
                        #
                        #
                        rocommunity public localhost
                        #
                        rocommunity public 192.168.123.0/24
                    

sudo service snmpd restart

Firewall Configuration

sudo ufw allow 161

Documentation

SNMP Documentation