{"id":1118,"date":"2015-07-31T17:58:33","date_gmt":"2015-07-31T17:58:33","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=1118"},"modified":"2019-07-16T21:48:42","modified_gmt":"2019-07-16T21:48:42","slug":"setting-up-snmp-v3-on-centos","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/setting-up-snmp-v3-on-centos\/","title":{"rendered":"Setting up SNMP V3 on CentOS"},"content":{"rendered":"<p>Install SNMP.<\/p>\n<pre>yum install net-snmp net-snmp-utils<\/pre>\n<p>Configure the SNMP V3 user by running the following command and then following the prompts it gives you.<\/p>\n<pre>net-snmp-create-v3-user<\/pre>\n<p>Example: The username is &#8220;snmpadmin&#8221; and the password is&#8221;r123456&#8243;<\/p>\n<pre>[root@localhost ~]# net-snmp-create-v3-user\nEnter a SNMPv3 user name to create:\nsnmpadmin\nEnter authentication pass-phrase:\nr123456\nEnter encryption pass-phrase:\n\u00a0 [press return to reuse the authentication pass-phrase]\n\nadding the following line to \/var\/lib\/net-snmp\/snmpd.conf:\n\u00a0\u00a0 createUser snmpadmin MD5 \"r123456\" DES\nadding the following line to \/etc\/snmp\/snmpd.conf:\n\u00a0\u00a0 rwuser snmpadmin\n[root@localhost ~]#\n\n<\/pre>\n<p>Change the syslocation and syscontact in the \/etc\/snmp\/snmpd.conf file.<\/p>\n<pre>vi \/etc\/snmp\/snmpd.conf<\/pre>\n<p>Start snmpd service<\/p>\n<pre>service snmpd start<\/pre>\n<p>Configure snmp to start on system boot.<\/p>\n<pre>chkconfig snmpd on<\/pre>\n<p>Test and make sure snmp is working<\/p>\n<p>replace &#8220;password&#8221; and &#8220;username&#8221; with the ones you setup when you created the SNMP V3 user.<\/p>\n<pre>snmpwalk -v3 -a MD5 -A password -x DES -X password -l authPriv -u privuser localhost<\/pre>\n<p>If you receive something like &#8220;snmpwalk: Timeout&#8221; then something is not working correctly.\u00a0 Check to make sure the service is started, and make sure that your firewall is not blocking SNMP.<\/p>\n<p>If you are running a firewall, run the following commands to allow it through.<\/p>\n<pre>firewall-cmd --zone=public --add-port=161\/udp --permanent\nsemanage port -a -t snmp_port_t -p udp 161\nfirewall-cmd --reload<\/pre>\n<p>On iptables you should be able to do<\/p>\n<pre> iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 161 -j ACCEPT<\/pre>\n<p>or add it to \/etc\/sysconfig\/iptables and then restart iptables<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install SNMP. yum install net-snmp net-snmp-utils Configure the SNMP V3 user by running the following command and then following the prompts it gives you. net-snmp-create-v3-user Example: The username is &#8220;snmpadmin&#8221; and the password is&#8221;r123456&#8243; [root@localhost ~]# net-snmp-create-v3-user Enter a SNMPv3 &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/setting-up-snmp-v3-on-centos\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,3,130],"tags":[17,160,7,133,261,171],"class_list":["post-1118","post","type-post","status-publish","format-standard","hentry","category-centos-linux","category-linux","category-snmp","tag-centos","tag-firewall","tag-linux-2","tag-snmp-2","tag-snmp-v3","tag-snmpd"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/1118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=1118"}],"version-history":[{"count":7,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/1118\/revisions"}],"predecessor-version":[{"id":2522,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/1118\/revisions\/2522"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=1118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=1118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=1118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}