配置范例:
snmp {
// 路由器名称
description R1-D-DP-1.CZW;
// 所在地理位置
location "DaPing Build 4F";
// 技术联络人
contact "xxxx. phone:xxxxx";
// SNMP Community配置
community zy-cqdx-snmp {
// 指定权限为只读
authorization read-only;
// 限定以下的地址发送SNMP查询的请求
clients {
61.183.1.48/32;
61.128.186.48/32;
}
}
// 配置主动SNMP讯息回报
trap-group all {
// 指定使用SNMP v2
version v2;
// 指定发送的事件类别
// 本文檔所提及的Trap所需的类别如下
categories {
authentication;
chassis;
link;
routing;
startup;
vrrp-events;
configuration;
sonet-alarms;
}
// 事件信息的目的主机
targets {
61.128.186.48;
}
}
}
// 于routing-options 下指定SNMP网管主机的静态路由(由管理端口fxp0送出)。
routing-options {
static {
route 61.128.186.48/32 next-hop 61.186.155.89;
route 61.183.1.48/32 next-hop 61.186.155.89;
}
}
// 要对LSP进行流量、封包数等进行SNMP计数,
// 必须开启以下的MPLS Statistics Gathering功能
// 建议使用的更新间隔为300秒(缺省值)
protocols {
mpls {
statistics {
file lsp.stats;
interval 300;
}
}
}
注意事项:
若保护路由引擎的Firewall Filter有对SNMP进行相关限制,应同时进行修改,使SNMP查询信息可以顺利到达路由引擎。