linux 防火墙snmp 配置文件,linux 下snmp 的配置

1、确保本机已经安装了snmp 服务

[root@idc ~]# rpm -qa |grep snmp

net-snmp -libs-5.1.2-11.EL4.7

net-snmp -5.1.2-11.EL4.7

如果没有,那么放入安装盘找到snmp 的rpm包进行安装,或者到网上搜索适合自己发行版本的rpm包进行安装

如果提示有依赖关系,那么通过yum install net-snmp -5.3.1…….rpm来安装。

2、snmpd.conf文件配置

按照如下方式修改snmpd.conf文件

A、修改默认的community string

com2sec notConfigUser default public

将public修改为你才知道的字符串

B、把下面的#号去掉(是干什么用的还没找到答案)

#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc

C、下面列出的是可以访问的oid,比如.1.3.6.1.2.1.1表示可以访问sys组的信息

# Make at least  snmpwalk -v 1 localhost -c public system fast again.

#       name           incl/excl     subtree         mask(optional)

view    systemview    included   .1.3.6.1.2.1.1

view    systemview    included   .1.3.6.1.2.1.25.1.1

view    systemview    included   .1.3.6.1.2.1.2

view    systemview    included   .1.3.6.1.2.1.4

D、把下面的语句

access notConfigGroup "" any noauth exact systemview none none

改成:

access notConfigGroup "" any noauth exact mib2 none none

是为了禁止对mib2的访问

3、重启snmpd服务

#/etc/rc.d/init.d/snmpd restart

或#service snmpd restart

完成snmpd的配置

4、确保linux 的iptables防火墙 对我们的流量监控 开放了udp 161端口的访问权限

可使用iptables –L –n 查看当前iptables规则

可编辑/etc/sysconfig/iptables文件来修改iptables规则。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值