RHEL9 snmpd.conf NMSからのアクセス許可サンプル方法のサンプル

環境
Red Hat Enterprise Linux release 9.2 (Plow)
snmpd 5.9.1

概要
NMS (Network Management Station) からのアクセスのみをMIB値を許容します。
localhostからSNMPの調査をするデバッグ作業をします。

使用例
1.NMSのIPアドレスは192.168.1.23とし、コミュニティ名はctnとして設定します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# vi /etc/snmp/snmpd.conf
#設定内容
# sec.name source community
com2sec notConfigUser 192.168.1.23 ctn
com2sec notConfigUser localhost ctn
# sec.model sec.name
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
# incl/excl subtree mask
view all included .1
# context sec.model sec.level prefix read write notify
access notConfigGroup "" any noauth exact all none none
# vi /etc/snmp/snmpd.conf #設定内容 # sec.name source community com2sec notConfigUser 192.168.1.23 ctn com2sec notConfigUser localhost ctn # sec.model sec.name group notConfigGroup v1 notConfigUser group notConfigGroup v2c notConfigUser # incl/excl subtree mask view all included .1 # context sec.model sec.level prefix read write notify access notConfigGroup "" any noauth exact all none none
# vi /etc/snmp/snmpd.conf
 
#設定内容
#       sec.name        source          community
com2sec notConfigUser   192.168.1.23    ctn
com2sec notConfigUser   localhost       ctn
 
#                       sec.model       sec.name
group   notConfigGroup  v1              notConfigUser
group   notConfigGroup  v2c             notConfigUser
 
#           incl/excl   subtree         mask
view all    included    .1              
 
#                       context sec.model sec.level prefix read   write notify
access notConfigGroup   ""      any       noauth    exact  all    none  none

2.snmpd再起動を行います
# systemctl restart snmpd.service

3.許可されたホストのみ疎通可能ことを確認します
# snmpwalk -v 2c -c ctn 192.168.1.23

IT

Posted by arkgame