Cisco、HUAWEI、H3c、Firewall等设备配置snmp
2024-09-03 21:53:13
配置HUAWEI交换机S1720、S2700、S5700、S6720等型号设备的snmp v3配置
注:此配置来源自官方配置文档
操作步骤
- 配置交换机的接口IP地址,使其和网管站之间路由可达
(图1)
# 按图1所示,配置交换机的接口IP地址。
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan 100
[Switch-vlan100] quit
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type hybrid
[Switch-GigabitEthernet0/0/1] port hybrid pvid vlan 100
[Switch-GigabitEthernet0/0/1] port hybrid untagged vlan 100
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface vlanif 100
[Switch-Vlanif100] ip address 10.1.2.1 24
[Switch-Vlanif100] quit- 配置交换机的SNMP版本为SNMPv3
[Switch] snmp-agent sys-info version v3
- 配置访问权限
# 配置ACL,使NMS2可以管理交换机,NMS1不允许管理交换机。
[Switch] acl 2001
[Switch-acl-basic-2001] rule 5 permit source 10.1.1.2 0.0.0.0
[Switch-acl-basic-2001] rule 6 deny source 10.1.1.1 0.0.0.0
[Switch-acl-basic-2001] quit# 配置MIB视图。
[Switch] snmp-agent mib-view included isoview iso
# 配置用户组。
[Switch] snmp-agent group v3 admin privacy write-view isoview acl 2001
# 配置用户。
[Switch] snmp-agent usm-user v3 nms2-admin group admin
# 对用户的数据进行认证,认证密码为Authe@1234。
[Switch] snmp-agent usm-user v3 nms2-admin authentication-mode sha
Please configure the authentication password (8-64)
Enter Password: //输入认证密码,本例的认证密码为:Authe@1234。
Confirm Password: //输入认证密码,本例的认证密码为:Authe@1234。# 对用户的数据进行加密,加密密码为Priva@1234。
[Switch] snmp-agent usm-user v3 nms2-admin privacy-mode aes128
Please configure the privacy password (8-64)
Enter Password: //输入加密密码,本例的加密密码为:Priva@1234。
Confirm Password: //输入加密密码,本例的加密密码为:Priva@1234。 - 配置告警主机
[Switch] snmp-agent target-host trap address udp-domain 10.1.1.2 params securityname nms2-admin v3 privacy
- 配置设备管理员联系方式
[Switch] snmp-agent sys-info contact call Operator at 010-12345678
- 配置网管站
在使用SNMPv3版本的NMS上需要设置用户名,选择安全级别。根据不同的安全级别,需要分别设置认证方式、认证密码、加密方式、加密密码等。网管的配置请根据采用的网管产品参考对应的网管配置手册。配置网管站
验证配置结果
配置完成后,可以执行下面的命令,检查配置内容是否生效。
# 查看SNMP版本。 [Switch] display snmp-agent sys-info version
SNMP version running in the system:
SNMPv3
# 查看用户组信息。 [Switch] display snmp-agent group admin
Group name: admin
Security model: v3 AuthPriv
Readview: ViewDefault
Writeview: isoview
Notifyview :<no specified>
Storage-type: nonVolatile
Acl:2001
# 查看MIB视图。 [Switch] display snmp-agent mib-view viewname isoview
View name:isoview
MIB Subtree:iso
Subtree mask:FC(Hex)
Storage-type: nonVolatile
View Type:included
View status:active
# 查看告警的目标主机。 [Switch] display snmp-agent target-host
Target-host NO. 1
-----------------------------------------------------------
IP-address : 10.1.1.2
Source interface : -
VPN instance : -
Security name : nms2-admin
Port : 162
Type : trap
Version : v3
Level : Privacy
NMS type : NMS
With ext-vb : No
-----------------------------------------------------------
# 配置设备管理员联系方式。 [Switch] display snmp-agent sys-info contact
The contact person for this managed node:
call Operator at 010-12345678配置文件
Switch的配置文件
#
sysname Switch
#
vlan batch 100
#
acl number 2001
rule 5 permit source 10.1.1.2 0
rule 6 deny source 10.1.1.1 0
#
interface Vlanif100
ip address 10.1.2.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
snmp-agent
snmp-agent local-engineid800007DB0300259E0370C3
snmp-agent sys-info contact call Operator at 010-12345678
snmp-agent sys-info version v3
snmp-agent group v3 admin privacy write-view isoview acl 2001
snmp-agent target-host trap address udp-domain 10.1.1.2 params securityname nms2-admin v3 privacy
snmp-agent mib-view included isoview iso
snmp-agent usm-user v3 nms2-admin
snmp-agent usm-user v3 nms2-admin group admin
snmp-agent usm-user v3 nms2-admin authentication-mode sha cipher %^%#odaJ7R)/O7k$pwQx0qfD0\`u*'GI1(|;ZQXHtzrN%^%#
snmp-agent usm-user v3 nms2-admin privacy-mode aes128 cipher %^%#f*K3/|E6d"SJes9)5naXPIqCTpR"}BUC=yW;!(f9%^%#
#
return
最新文章
- ajaxform使用
- Linux 下编译升级 Python
- Android实现自定义带文字和图片的Button
- MySQ中Lmax_connections的合理设置
- PHP面向对象的标准
- Number Sequence(KMP,判断子串 模板)
- [HDU 5029] Relief grain
- 03 - 替换vtkDataObject中的GetProducerPort()方法 VTK 6.0 迁移
- linux 使用ptrace函数时找不到头文件 .h 或者找不到某个宏的解决方法
- mysql sql_mode 之 NO_ENGINE_SUBSTITUTION
- poj 3287 The Trip, 2007_贪心
- [ An Ac a Day ^_^ ] hrbust 2291 Help C5 分形
- 预计2019年发布的Vue3.0到底有什么不一样的地方?
- Verilog手绘FVH信号
- django template模板 母板 include导入
- C# File API
- kafka libjvm 报错
- java中CRUD(增删查改)底层代码的实现
- [ English ] 俚语 “Ping me=打我电话”
- Javascript富文本编辑器