目標
網管在管理設備時使用SNMPv2c版本保證互通,在互通的過程中限制該網管可以管理設備上的部分MIB節點。
組網需求
如圖1所示,在網絡中,用戶的兩個網管和路由器通過公網相連,由于業務的需求,用戶規劃網管NMS2可以管理路由器上的所有節點,網管站NMS1不再管理該路由器。
NMS2管理路由器的過程中,為了方便對告警信息進行定位,避免過多的無用告警對處理問題造成干擾,用戶只允許缺省打開的模塊可以發送告警至NMS。由于路由器發送的告警需要經過公網才能被網管接收,為了保證告警接收的可靠性,采用Inform方式告警。
由于網管管理員離路由器較遠,為了使路由器出現故障時網管管理員能快速聯系上設備管理員,以便對故障進行定位和排除,故要求在路由器上配置設備管理員的聯系方法。
配置思路
- 使能SNMP Agent。
- 配置路由器的SNMP版本為SNMPv2c。
- 配置用戶訪問權限,限制NMS2可以管理路由器上的節點。
- 配置路由器的Inform告警功能,使路由器產生的告警能夠發送至NMS。
- 配置設備管理員聯系方式。
- 配置網管站(NMS2)。
操作步驟
- 配置路由器和網管站之間路由可達(略)
- 使能SNMP Agent。
snmp-agent password min-length 10
snmp-agent
- 配置路由器的SNMP版本為SNMPv2c。
snmp-agent sys-info version v2c v3
默認啟用v3,配置v2c后v3也仍然保留
查看SNMP版本。
[~DeviceA] dis snmp-agent sys-info version
SNMP version running in the system:
SNMPv2c SNMPv3
[~DeviceA]
- 配置網管站的訪問權限。
配置ACL,限制NMS2可以管理路由器,NMS1不允許管理路由器。
acl number 2001
rule 5 permit source 1.1.1.2 0
rule 6 deny source 1.1.1.1 0
配置MIB視圖
snmp-agent mib-view excluded allexthgmp enterprises.2001.6.7
默認是所有視圖都可以看到
配置團體名引用ACL和MIB視圖。
[~DeviceA] snmp-agent community write adminnms2aa mib-view allexthgmp acl 2001
團體名長度要求至少10個,配置完成后顯示被加密
snmp-agent community write cipher %^%#NOL(CEv+31)2/ZM^_=/;r+LS>r8;'q2x.YjMw55So`k9ikf_~>~&@TeH}GPw4)0:7H(='t*3kLPCNW;%^%# mib-view allexthgmp acl 2001
- 配置告警功能。
snmp-agent target-host inform address udp-domain 1.1.1.2 params securityname cipher %^%#(Xdl+@ZV>OSn3S=C"*sM=a|GAi:}(!G>^4C+#|1=%^%# v2c
snmp-agent inform timeout 5
snmp-agent inform resend-times 6
snmp-agent inform pending 7
snmp-agent trap enable
snmp-agent notification-log enable
inform配置以后,密碼被加密
[~DeviceA]snmp-agent target-host inform address udp-domain 1.1.1.2 params securityname Huawei-1234 v2c
global-ageout默認就是24,配置后不顯示
- 配置網管站(NMS2)。
網管的配置請根據采用的網管產品參考對應的網管配置手冊。
- 驗證配置結果。
配置完成后,可以執行下面的命令,檢查配置內容是否生效。
查看SNMP版本。
[~DeviceA]dis snmp-agent sys-info version
SNMP version running in the system:
SNMPv2c SNMPv3
[~DeviceA]
查看團體名的配置信息。
[~DeviceA]dis snmp-agent community
Community name: %^%#NOL(CEv+31)2/ZM^_=/;r+LS>r8;'q2x.YjMw55So`k9ikf_~>~&@TeH}GPw4)0:7H(='t*3kLPCNW;%^%#
Group name: %^%#NOL(CEv+31)2/ZM^_=/;r+LS>r8;'q2x.YjMw55So`k9ikf_~>~&@TeH}GPw4)0:7H(='t*3kLPCNW;%^%#
Acl: 2001
Storage-type: nonVolatile
[~DeviceA]
查看ACL配置。
[~DeviceA]dis acl 2001
Basic ACL 2001, 2 rules
ACL's step is 5
rule 5 permit source 1.1.1.2 0 (0 times matched)
rule 6 deny source 1.1.1.1 0 (0 times matched)
[~DeviceA]
查看MIB視圖。
[~DeviceA]dis snmp-agent mib-view viewname allexthgmp
View name: allexthgmp
MIB Subtree: enterprises.2001.6.7
Subtree mask: FF80(Hex)
Storage-type: nonVolatile
View Type: excluded
View status: active
[~DeviceA]
查看告警的目標主機。
[~DeviceA]dis snmp-agent target-host
Target host NO. 1
---------------------------------------------------------------------------
Host name :
IP address : 1.1.1.2
Source interface : -
VPN instance : -
Security name : %^%#(Xdl+@ZV>OSn3S=C"*sM=a|GAi:}(!G>^4C+#|1=%^%#
Port : 162
Type : inform
Version : v2c
Level : No authentication and privacy
NMS type : NMS
With ext vb : No
Notification filter profile name : -
Heart beat required : No
---------------------------------------------------------------------------
[~DeviceA]
配置設備管理員聯系方式。
[~DeviceA]dis snmp-agent sys-info contact
The contact person for this managed node:
R&D Beijing, Huawei Technologies co.,Ltd.
[~DeviceA]