> For the complete documentation index, see [llms.txt](https://netsnmp-install.netdpi.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://netsnmp-install.netdpi.net/home/01-01_install_netsnmp_and_setup_netsnmp.md).

# 01.01-安裝及設定檔配置

步驟一：至官方網站下載 netsnmp 原始碼，可選擇所需的版本，本文為 net-snmp-5.5.tar.gz。

\#tar –xzf net-snmp-5.5.tar.gz

步驟二：將原始碼解壓縮

步驟三：進入net-snmp-5.5

\#cd net-snmp-5.5

步驟四：Configure

\[net-snmp-5.5]#./configure

步驟五：編譯並安裝

\[net-snmp-5.5]#sudo make

\[net-snmp-5.5]#sudo make install

步驟六：設定檔配置

\[net-snmp-5.5]#sudo cp EXAMPLE.conf /usr/local/share/snmp/snmpd.conf

\[net-snmp-5.5]#sudo vim /usr/local/share/snmp/snmpd.conf

如圖 1，先設定相關必備的IP存取權限，以供測試使用。設定 agent 可使用 localhost (127.0.0.1) 或本機端 IP (192.168.13.13) 進行存取。

<figure><img src="/files/KHoCfpGmGfSvSU14JBCd" alt=""><figcaption><p>圖 1設定 snmpd listen 的 IP</p></figcaption></figure>

如圖 2，分別針對read-only以及read-write群組作名稱對應，分別為public以及private。再使用定義的名稱對特定的網域作存取權限管控。

<figure><img src="/files/KxihVIF8idDihhAr0T6h" alt=""><figcaption><p>圖 2設定read-only以及read-write群組</p></figcaption></figure>

上述設定完成後，必須重新啟動電腦才可以正常啟動。

\[net-snmp-5.5]#sudo reboot
