使用SNMP管理及配置cisco交换机
- 格式:doc
- 大小:62.50 KB
- 文档页数:3
一、在思科的路由器上配置SNMP(启用SNMP代理)、开启SNMP服务5、案例:配置网管工作站接收被管设备的陷阱消息(1)启用陷阱消息接收器----打开162端口(2)配置团体名(3)在snmp代理上配置陷阱消息snmp-server host 192.168.4.231 sdxh #配置陷阱消息的目标snmp-server enable traps config #配置启用trap 配置事件(注:只是其中的一种消息类型,可以配置多个)(4)效果二、在思科交换机上配置SNMP1、配置管理地址三、在思科ASA上启用SNMP1、防火墙只支持只读SNMP2、SNMPv3支持更强的认证:用户名、认证密钥、加密密钥四、在Windows Server上启用SNMP在Linux中启用SNMP五、五、在1、yum仓库的配置(以本地光盘为yum安装源)mount /dev/cdrom /media/cdrom/rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 导入签名密钥1)、vi /etc/yum.repos.d/rhel6.repo[rhel-source] #仓库的名称name=Red Hat Enterprise Linux $releasever - $basearch - Source #描述baseurl=file:///media/cdrom #位置enabled=1 #启用仓库gpgcheck=1 #启用签名检查gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release #签名密钥3)、相关软件包将snmp服务设为开机自动启动:修改允许查看的MIB库信息87 view all included .1 8091 view mib2 included .dod.internet.mgmt.mib-2 fc 设置团体名的权限(在文件的结尾)snmpwalk -v 2c 192.168.4.213 -c sdxh systemsnmpwalk -v 2c 192.168.4.254 -c sdxh ifDescr.1snmpnetstat -v 2c -c sdxh -Ca -Cp tcp 192.168.4.213 #查看tcp连接启用SNMP-V3:3、【补充】Setting Up SNMPThis HowTo will explain how to install and configure the Net-SNMP agent. At time of writing, the latest version available is 5.4 (published on 12/06/2006).Getting Net-SNMP binariesDepending on your operating system, you'll find packages or tarballs to install Net-SNMP :LinuxUsually every Linux distribution comes with Net-SNMP packages :RedHat / Fedora : install the net-snmp, net-snmp-libs and net-snmp-utils packagesDebian / Ubuntu: install the libsnmp-base, libsnmp5, snmp and snmpd packagesSuSE : install the net-snmp packageGentoo : simply emerge the net-snmp ebuildMandriva : install the libnet-snmp5, net-snmp and net-snmp-utils packages.agentaddress 10.20.30.40:10000You can also make it listens on TCP, which is supported by Cactiagentaddress tcp:161The “tcp” keyword can then be used in Cacti :For those who want some more security, you can use the SNMP version 3 protocol, with MD5 or SHA hashing:createUser frederic MD5 mypassphrase DESgroup groupv3 usm fredericview all included .iso 80access groupv3 "" any auth exact all all allThis creates a user “frederic” whose password is “mypassphrase”. To test it:# snmpget -v 3 -l AuthNoPriv -u frederic -A mypassphrase 10.50.80.45 sysName.0SNMPv2-MIB::sysName.0 = STRING: cyclopesIn Cacti, add your device, choose SNMP version 3, and fill the username and password fields:Now that you're done with access control, add these 2 lines in snmpd.conf to indicate the location and contact name of your device:syslocation Bat. C2syscontact someone@They will then appear in Cacti management interface :Some OIDs return a unit, eg ”-153.1 dBm”.It's a safe idea to turn this off, by adding this to snmpd.conf:dontPrintUnits trueNext step is to graph filesystems in Cacti; the easyest way is to add this line in snmpd.conf:includeAllDisksWhen you'll run the “ucd/net - Get Monitored Partitions” Data Query, all the mounted filesystems will show up:If you want a filesystem not to be listed here, add this line to snmpd.conf:ignoredisk /dev/rdsk/c0t2d0Unfortunatly, some older versions of Net-SNMP do not fully work with the includeAllDisks keywordYou'll then have to list explicitly all filesystems you want to graph:disk /disk /usrdisk /vardisk /oracleYou can also specify NFS mount points.Please note that the Net-SNMP agent can only report filesystems which where mounted before its start.If you manually mount filesystems later, you'll have to reload the Net-SNMP agent (send the HUP signal).You can also graph processes, by adding this to snmpd.conf:proc httpdThe result will be accessible under the ucdavis.prTable.prEntry tree:prCount, number of current processes running with the name in questionprNames, the process name you're counting.In our example, the number of Apache processes will be available under the .1.3.6.1.4.1.2021.2.1.5 OID Some useful mib modules are:mibII/mta_sendmail, to graph MTA (Sendmail, Postfix, etc.) statisticsdiskio, to enable to graph I/O statisticsucd-snmp/lmSensors, for hardware monitoring (Linux and Solaris only)Mib modules can be added like this:$ ./configure --with-mib-modules="module1 module2"To compile Net-SNMP and build a compressed archive, follow these steps:$ ./configure --with-your-options$ make# mkdir /usr/local/dist# make install prefix=/usr/local/dist/usr/local exec_prefix=/usr/local/dist/usr/local# cd /usr/local/dist# tar cvf /tmp/net-snmp-5.3.1-dist.tar usr# gzip /tmp/net-snmp-5.3.1-dist.tar# rm -rf /usr/local/distYou can then copy the /tmp/net-snmp-5.3.1-dist.tar.gz file to other servers, and uncompress it from the root directory (everything will get extracted to /usr/local).Test your configurationOnce Net-SNMP is configured and started, here's how to test it:$ snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1.1.0SNMPv2-MIB::sysDescr.0 = STRING: Linux cronos 2.4.28 #2 SMP ven jan 14 14:12:01 CET 2005 i686This basic query shows that your Net-SNMP agent is reachable.You can even query which Net-SNMP version is running on a host:$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.100.2.0UCD-SNMP-MIB::versionTag.0 = STRING: 5.2.1.2An answer like that one$ snmpwalk -v 1 -c foo localhost .1.3.6.1.2.1.1.1.0Timeout: No Response from localhostindicates that either the agent is not started, or that the community string is incorrect, or that this device is unreachable. Check your community string, add firewall rules if necessary, etc.If using SNMP version 3, specifying an unknown user will result in this error message :$ snmpget -v 3 -l AuthNoPriv -u john -A mypassphrase 10.50.80.45 sysName.0snmpget: Unknown user nameAn incorrect passphrase will result in this error message :$ snmpget -v 3 -l AuthNoPriv -u frederic -A badpassphrase 10.50.80.45 sysName.0snmpget: Authentication failure (incorrect password, community or key)This query will show you what filesystems are mounted:$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.9.1.2UCD-SNMP-MIB::dskPath.1 = STRING: /UCD-SNMP-MIB::dskPath.2 = STRING: /BBUCD-SNMP-MIB::dskPath.3 = STRING: /dev/shmIf the answer is empty, usually it means the includeAllDisks is not supported by your Net-SNMP agent (you'll have to list each filesystem you want to graph as explained in previous chapter).Finally, this query will you display your network interfaces:$ snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.2.2.1.2IF-MIB::ifDescr.1 = STRING: loIF-MIB::ifDescr.2 = STRING: eth0IF-MIB::ifDescr.3 = STRING: eth1Extending the SNMP AgentA great functionnality of Net-SNMP is that you can “extend” it.Let's run the /tmp/foo.sh script:$ /tmp/foo.sh -arg1123Now put this in snmpd.conf:exec foo /bin/sh /tmp/foo.sh -arg1The result of your script will be accessible under the ucdavis.extTable.extEntry tree: * output of the script :ucdavis.extTable.extEntry.extOutput * exit status: ucdavis.extTable.extEntry.extResult * command:ucdavis.extTable.extEntry.extCommandYou can check the result with this SNMP query:$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8.1UCD-SNMP-MIB::extIndex.1 = INTEGER: 1UCD-SNMP-MIB::extNames.1 = STRING: fooUCD-SNMP-MIB::extCommand.1 = STRING: /bin/sh /tmp/foo.sh -arg1UCD-SNMP-MIB::extResult.1 = INTEGER: 0UCD-SNMP-MIB::extOutput.1 = STRING: 123UCD-SNMP-MIB::extErrFix.1 = INTEGER: 0UCD-SNMP-MIB::extErrFixCmd.1 = STRING:extOutput translates to .1.3.6.1.4.1.2021.8.1.101 As “foo” is our first exec directive, add .1 at the end of the OID.In Cacti, use the “SNMP - Generic OID Template” like this:Voila! Result of the /tmp/foo.sh script is now graphed in Cacti.Now let's run this second script, which returns more than one result:$ /tmp/bar.sh456789It returns two values, one per line (this is important).Another way to call scripts from snmpd.conf is by specifying an OID, like this:exec .1.3.6.1.4.1.2021.555 /bin/sh /tmp/bar.shRun this query:$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.555UCD-SNMP-MIB::ucdavis.555.1.1 = INTEGER: 1UCD-SNMP-MIB::ucdavis.555.2.1 = STRING: "/bin/sh"UCD-SNMP-MIB::ucdavis.555.3.1 = STRING: "/tmp/bar.sh"UCD-SNMP-MIB::ucdavis.555.100.1 = INTEGER: 0UCD-SNMP-MIB::ucdavis.555.101.1 = STRING: "456"UCD-SNMP-MIB::ucdavis.555.101.2 = STRING: "789"UCD-SNMP-MIB::ucdavis.555.102.1 = INTEGER: 0UCD-SNMP-MIB::ucdavis.555.103.1 = ""First line returned by the script will be available at .1.3.6.1.4.1.2021.555.101.1, second one at .1.3.6.1.4.1.2021.555.101.2, and so on.You can then use the “SNMP - Generic OID Template” in Cacti (one Data Source per OID).Let's say you want to count the number of entries in a log file. Add this to snmpd.conf:logmatch cactistats /home/cactiuser/cacti/log/cacti.log 120 SYSTEM STATS* the global count of matches will be available under the .1.3.6.1.4.1.2021.16.2.1.5.1 OID * the “Regex match counter” (which is reset with each file rotation) will be available under the .1.3.6.1.4.1.2021.16.2.1.7.1 OIDTo list all the available variables, use this query:$ snmpwalk -v 1 -c public localhost logMatchUCD-SNMP-MIB::logMatchMaxEntries.0 = INTEGER: 50UCD-SNMP-MIB::logMatchIndex.1 = INTEGER: 1UCD-SNMP-MIB::logMatchName.1 = STRING: cactistatsUCD-SNMP-MIB::logMatchFilename.1 = STRING: /home/cactiuser/cacti/log/cacti.logUCD-SNMP-MIB::logMatchRegEx.1 = STRING: SYSTEM STATSUCD-SNMP-MIB::logMatchGlobalCounter.1 = Counter32: 301634UCD-SNMP-MIB::logMatchGlobalCount.1 = INTEGER: 301634UCD-SNMP-MIB::logMatchCurrentCounter.1 = Counter32: 6692UCD-SNMP-MIB::logMatchCurrentCount.1 = INTEGER: 6692https:///autho/forms/CDClogin.html# 获取端口Index[root@redhat mibs]# snmpwalk -v 2c 192.168.4.254 -c sdxh 1.3.6.1.2.1.2.2.1.1 IF-MIB::ifIndex.1 = INTEGER: 1IF-MIB::ifIndex.2 = INTEGER: 2IF-MIB::ifIndex.3 = INTEGER: 3# 获取端口列表及其描述[root@redhat mibs]# snmpwalk -v 2c 192.168.4.254 -c sdxh 1.3.6.1.2.1.2.2.1.2 IF-MIB::ifDescr.1 = STRING: FastEthernet0/0# 以下为获取交换机第2个端口(INT E GE R: 2)所连接主机的M AC地址操作例子################################### 步骤 1 ##############################snmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.25 1.3.6.1.2.1.17.4.3.1 | grep -w "INTEGER: 2"返回结果:SNMPv2-SMI::mib-2.17.4.3.1.2.0.7.233.63.136.173 = INTEGER: 2################################### 步骤 2 ############################### 从以上步骤1的返回结果获取粗体字"0.7.233.63.136.173" ,并执行以下命令snmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.25 1.3.6.1.2.1.17.4.3.1 | grep "0.7.233.63.136.173" | grep "mib-2.17.4.3.1.1"返回结果:SNMPv2-SMI::mib-2.17.4.3.1.1.0.7.233.63.136.173 = Hex-STRING: 00 07 E9 3F 88 AD00 07 E9 3F 88 AD为交换机的第2口所连接的主机网卡地址################################### 步骤 3 ##############################snmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.25 1.3.6.1.2.1.17.1.4.1.2 | grep -w "SNMPv2-SMI::mib-2.17.1.4.1.2.2"这里的红色2是步骤1的 INTEGER: 2返回结果:SNMPv2-SMI::mib-2.17.1.4.1.2.2 = INTEGER: 2步骤3中获取到的INTEGER: 2才是对应的IfIndexsnmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.41 1.3.6.1.2.1.17.4.3.1.1snmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.41 1.3.6.1.2.1.17.4.3.1.2snmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.41 1.3.6.1.2.1.17.1.4.1.2/en/US/tech/tk648/tk362/technologies_tech_note09186a00801576ff.shtml在华为-H3C设备上启用SNMP服务六、六、在华为在线文档:实验环境:1、开启SNMP-Agent<Huawei> system-view[Huawei]interface g0/0/1[Huawei]acl 2001[Huawei]snmp-agent community write xinhua acl 20013、配置SNMP trap消息[AR2220]snmp-agent target-host trap-hostname mbxb address 192.168.4.231 udp-port 162 trap-paramsname sdxh4、保存配置七、在华为交换机上启用SNMP华为交换机的基本操作:[Huawei]interface vlanif 1[Huawei-Vlanif1]ip address 192.168.1.4 24[Huawei]interface GigabitEthernet0/0/1port link-type access #设置接口的类型-accessport default vlan 1 #设置默认VLANundo shutdown[Huawei]snmp-agent community read xinhua[Huawei]snmp-agent sys-info contact 12345[Huawei]snmp-agent sys-info location jinanshi[Huawei]snmp-agent sys-info version all[Huawei]snmp-agent target-host trap address udp-domain 192.168.1.230 udp-port 162 params securityname xinhua [Huawei]snmp-agent trap enable。
CISCO交换机基本配置和使用概述CISCO交换机是一种常用的网络设备,用于构建局域网(Local Area Network,LAN)。
它可以通过物理线路的连接,将多台计算机或其他网络设备连接到同一个网络中,实现数据的传输和共享。
CISCO交换机的基本配置包括IP地址的配置、VLAN的配置、端口配置、安全性配置等。
接下来,我们将对这些配置进行详细说明。
首先,IP地址的配置是CISCO交换机的基本操作之一。
通过配置IP地址,我们可以对交换机进行管理和监控。
具体的配置步骤如下:1. 进入交换机的配置模式。
在命令行界面输入"enable"命令,进入特权模式。
2. 进入全局配置模式。
在特权模式下输入"configure terminal"命令,进入全局配置模式。
3. 配置交换机的IP地址。
在全局配置模式下输入"interfacevlan 1"命令,进入虚拟局域网1的接口配置模式。
然后输入"ip address 192.168.1.1 255.255.255.0"命令,配置交换机的IP地址和子网掩码。
4. 保存配置并退出。
在接口配置模式下输入"exit"命令,返回到全局配置模式。
然后输入"exit"命令,返回到特权模式。
最后输入"copy running-config startup-config"命令,保存配置到闪存中。
其次,VLAN的配置是CISCO交换机的关键配置之一。
通过配置VLAN,我们可以将交换机的端口划分为不同的虚拟局域网,实现数据的隔离和安全。
1. 进入交换机的配置模式。
同样,在特权模式下输入"configure terminal"命令,进入全局配置模式。
2. 创建VLAN。
在全局配置模式下输入"vlan 10"命令,创建一个编号为10的VLAN。
思科神州数码中兴等镜像snmp等配置手册一.连接交换机进行配置1.硬件连接交换机A.交换机Console方式进行连接,另外一端连接电脑的Com口或是com转接usb口B.Telnet等方式远程登录连接(需要配置交换机IP以及启用相关的功能)2.硬件连接之后,本地连接交换机进行相关的配置.A. Console-Com口通讯方式配置:开始→附件→通讯→超级终端.建立一个新的连接,连接使用Com口,将填入相关的参数.B. Telnet等方式进行远程访问.在运行里面输入telnet Ip地址进行连接配置二.相关交换机的镜像配置本处将列举思科华为H3C神州数码中兴等部分交换机的镜像配置方法,今后将对其它交换机配置方法进行补充.交换机权限>enable 进入enable模式#config Terminal 进入config模式(config) #interface FastEthernet 0/1 进入0/1端口配置(config-if)#每个权限下有各个权限的命令,在别的权限下输入命令不会生效镜像和SNMP都是在(config)#权限下进行配置的1.思科A. 29XX型号(部分,可以跟下面B.部分结合使用)(config)#monitor session 1 source interface FastEthernet 0/1-23 (config)#monitor session 1 destination interface FastEthernet 0/24 end命令解释将交换机的0号模块1-23号端口作为mirrored端口将交换机的0好模块24端口作为mirror端口取消镜像功能(config)#no monitor session 1 source interface FastEthernet 0/1-23B.思科2900XL/3500XL/2950(部分,命令可以参考A部分)(config)#interface FastEthernet 0/1(config-if)prot monitor FastEthernet 0/12-18end命令解释进入0/1模块进行配置将0/12到18端口的数据mirror到0/1端口C.4000,5000, 6000 系列(config)#set span 0/12-17 0/1end命令解释将0/12到17的数据mirror到0/1端口特别注意:配置好镜像功能后,必须在#模式下对路由器做的配置进行保存,命令为#write2.华为镜像配置华为交换机权限分为< >和[ ]两种模式,在<>模式下是不能对交换机进行配置的,在<>模式下键入system进入[]模式.A.S2008/S2016/S2026/S2403H/S3026等型号[ ]monitor-prot Ethernet 0/1[ ]port mirror ethernet 0/10 to ethernet 0/15[ ]save命令解释:将ethernet 0/1 作为mirror端口将Ethernet0/10到0/15端口作为mirrored端口保存配置.3.H3C镜像配置H3c交换机权限分为<>和[],在模式下不能对交换机进行配置,在<>模式下键入system-view进入[ ]模式哦A.S3100/S3600/S5100/S7500等产品配置[ ]mirror-group 1 local[ ]mirror-group 1 monitor-port FastEthernet1/0/7[ ]mirror-group 1 mirroring-port FastEthernet1/0/1[ ]save命令解释:镜像源端口为1/0/1 对接受发送的报文都进行镜像镜像目的端口为1/0/7保存设置4.神州数码镜像配置(config)#monitor session 1 source interface FastEthernet 0/1-23 (config)#monitor session 1 destination interface FastEthernet 0/24 end命令解释将交换机的0号模块1-23号端口作为mirrored端口将交换机的0好模块24端口作为mirror端口5.中兴交换机镜像配置A. zxr10 t160g/t64g/t40g等镜像配置(config)#interface fei_1/1(config-if)#monitor session 1 source(config)#interface fei_1/3(config-if)#monitor session 1 destination命令解释:将fei_1/1端口作为镜像源将fei_1/3端口作为目的地综上:作为mirrored端口的速度要小于mirror端口,否则接受的信息不会完整,上述的例子中可能会存在千兆网卡(Gigabit Ethernet),部分交换机支持简写如Gigabit Ethernet 简写为GE或gei, FastEthernet 简写为FE 或是fei. 将镜像配置完全后必须要save或是write到交换机中.三.相关交换机的SNMP配置思科大部分交换机配置snmp为:在(config)#模式下(config)#snmp-server community publice ro(config)#snmp-server community private rw(config)#snmp-server enable traps(config)#snmp-server host ip rw(config)#end#write命令解释:配置snmp信息的只读字符串(ro)为public配置snmp信息的读写字符串(rw)为private启用snmp的tarps功能配置网管工作站ip 地址退出保存注意:public 和private 可以自己随便设置.部分思科交换机的配置:(config)#snmp-agent community read public(config)#snmp-agent community write private(config)#snmp-agent trap enable(config)#snmp-agent target-host trap address udp-domain ip udp-port 5000 params securityname public命令解释:交换机只读字符串为public交换机读写字符串为private交换机启用trap功能配置管理网关地址ip 5000端口华为交换机snmp配置[ ]snmp-agent community read public[ ]snmp-agent community write private[ ]snmp-agent sys-info version all命令解释交换机制度字符串为public交换机读写字符串为private交换机认证版本为全部版本(可以是1\2c\v3)神舟数码snmp配置(config)#snmp-server community rw private (config)#snmp-server community ro public (config)#snmp-server securityip ip命令解释:设置snmp读写字符串为private设置snmp只读字符串为public设置网关管理ip地址h3c snmp配置(config)#snmp-agent community read public (config)#snmp-agent community write public (config)#snmp-agent sys-info version all命令解释:设置snmp读写字符串为private设置snmp只读字符串为public设置snmp认证版本信息为all(可以是1\2c\v3) 中兴snmp设置SNMP的团体名目前只设置只读属性的share,SNMP的目标主机为两个:218.22.16.5和202.102.198.62。
怎么设置SNMP管理思科设备Cisco依靠自身的技术和对网络经济模式的深刻理解,成为了网络应用的成功实践者之一,那你知道怎么设置SNMP管理思科设备吗?下面是店铺整理的一些关于怎么设置SNMP管理思科设备的相关资料,供你参考。
设置SNMP管理思科设备的方法:先执行一下how run命令,如果配置信息中有关于SNMP的内容,我们可以修改,使之符合我们的要求,如果没有的话,就需要进行设置了。
1.Cisco 2924和Cisco 2950交换机用如下命令进行设置出于网络安全的考虑,一是密码需要修改为较安全的密码,二是不建议设置RW(读写)的SNMP设置。
2.如果是Cisco 3550交换机的话,配置SNMP如下:3.Cisco 7507路由器4.Cisco PIX520防火墙其实在Cisco设备上进行SNMP设置的命令基本上是一样的。
5.查看SNMP配置(1)Cisco 29系列6.SNMP Community字符串密码的修改如果我们按照系统默认的密码(即只读的密码为public,读写的密码为private)的话,会带来非常大的安全隐患,所以我们要修改密码,在进行SNMP设置时,用自己定义的密码。
比如Switch(config)#snmp-server community ****** RO (*号代表自定义的密码)7.保证安装有SNMP管理软件的PC机与Cisco设备可以正常通信最简单的办法就是Ping一下看能不能通。
根据我的实际经验,只要PC机可以Ping通Cisco设备即可进行SNMP管理,这跟Cisco设备的日志服务器不同,日志服务器必须要保证Cisco可以Ping通日志服务器主机。
因为进行SNMP管理,PC机是读取Cisco设备中的MIB 库信息,而日志服务器却是接收Cisco设备发来的信息。
SNMP网管软件的使用SNMP的网管软件有很多,在此我只介绍一款名为Solarwinds的软件,这个软件的功能很多,但是我在此只介绍其中的两项最实用的功能。
S N M P配置手册(总22页) -CAL-FENGHAI.-(YICAI)-Company One1-CAL-本页仅作为文档封面,使用请直接删除1交换机部分1.1Cisco交换机使用以下配置命令前,均需要执行以下步骤:1.登陆交换机。
(可以使用串口线直接连接,如果交换机配置有管理IP 并且允许telnet登陆,则也可以通过telnet进行登陆。
)2.输入enable命令进入特权模式。
3.输入config terminal进行配置模式。
使用完配置命令后,均需要执行以下步骤进行保存:1.输入end命令退出配置模式。
2. copy running start保存配置文件。
1.1.1SNMP配置1.配置snmp 只读communitysnmp-server community public ro配置交换机的只读community为public2.配置snmp 读写communitysnmp-server community public rw配置交换机的读写community为public1.1.2TRAP配置1.配置交换机允许发送trapsnmp-server enable traps2.配置交换机接收trap的主机snmp-server host traps public指定交换机SNMP Trap的接收者为,发送Trap时采用public作为字串1.1.3Syslog配置1.打开交换机的syslog功能logging on2. 直接配置相应的syslog发送到的接收主机,为该主机的ip地址。
logging3.配置发送syslog的主机格式类型。
logging facility local44.选择发送warning以上级别的log信息。
logging trap warnings1.2 华为交换机使用以下配置命令前,均需要执行以下步骤:1.登陆交换机。
(可以使用串口线直接连接,如果交换机配置有管理IP 并且允许telnet登陆,则也可以通过telnet进行登陆。
精心整理1交换机部分1.1Cisco交换机使用以下配置命令前,均需要执行以下步骤:1.登陆交换机。
(可以使用串口线直接连接,如果交换机配置有管理IP并且允许telnet登陆,则也可以通过telnet进行登陆。
)231212配置交换机的读写community为public1.1.2TRAP配置1.配置交换机允许发送trapsnmp-serverenabletraps2.配置交换机接收trap的主机snmp-serverhosttraps public指定交换机SNMPTrap的接收者为,发送Trap时采用public作为字串1.1.3Syslog配置1.打开交换机的syslog功能2.341.21登2.输入system命令进入配置模式。
使用完配置命令后,均需要执行以下步骤进行保存:1.输入return命令退出配置模式。
2.Save保存配置文件。
1.2.1SNMP配置1.启用SNMPsnmp-agent2.配置snmp协议的版本号snmp-agentsys-infoversionall上面的命令是指对SNMPV1、V2C、V3都支持。
3.配置snmp只读community41.2.2TRAP121.2.3Syslog配置1.启用交换机的syslog功能info-centerenable2.指定接收syslog的主机,为该主机的ip地址。
info-centerloghostlanguageEnglish以上命令是配置接收syslog,syslog的语言为英文。
3.选择发送warning以上级别的syslog信息。
info-centersourcedefaultchannelloghostloglevelwarning1.3中兴交换机1.登2.3.1.1.3.1SNMP1snmp-serverviewAllViewinternetincludedsnmp-serverviewtestzxr10IPAddrTableincludedsnmp-serverviewtestzteincludedsnmp-serverviewtestmib-2included1.3.2TRAP配置1.配置交换机允许发送trapsnmp-serverenabletrap2.配置交换机接收trap的主机snmp-serverhosttrapversion2cpublic1.3.3Syslog12.3.2在操作系统缺省的SNMP团体名。
Cisco交换机常用的配置命令的步骤Cisco交换机常用的配置命令的步骤Cisco交换机常用的配置命令的方法Switch(config)#snmp-server community private rw3、更改SNMP的Community密码a、将设备分组,并使能支持的各种SNMP版本Switch(config)#snmp-server group qycx123 v1Switch(config)#snmp-server group qycx 123 v2cSwitch(config)#snmp-server group qycx123 v3 noauthb、分别配置只读和可写community 如:Switch(config)#snmp-server community qycx123 ro Switch(config)#snmp-server community qycx123 rw4、保存交换机配置Switch#copy run start常用命令1、设置交换机密码a、更改远程TELNNET密码Switch#configure terminalSwitch(config)#line vty 0 4Switch(config-line)#password qycx123 Switch(config-line)#loginSwitch(config-line)#exitb、更改进入全局配置模式时的密码Switch#configure terminalSwitch(config)#enable secret qycx1232、创建并划分VLANa、创建VLANSwitch#vlan databaseSwitch(vlan)#vlan 99 name office (创建vlan 99 并命名为office)b、将端口划分至vlanSwitch(config)#interface fastEthernet 0/8Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 99(将8号快速以太口划分至vlan 99)3、常用调试命令a、显示所有配置命令:Switch#show runb、显示所有接口状态:Switch#show ip int briefc、显示所有VLAN的信息:Switch#show vlan brief 看了Cisco交换机常用的配置命令还想看:1.Cisco交换机常用配置命令总结2.Cisco常用的路由器交换机配置命令3.思科常用配置命令及参数4.思科交换机配置命令介绍5.Cisco交换机常用的功能性命令6.cisco交换机最常用的命令(含恢复密码)大全Cisco交换机初始化配置的教程Cisco交换机初始化配置的教程的方法首先进入全局模式enableconfig terminal一、telnet登录line vty 0 4password ********login二、主机名hostname ****三、enable密码enable secret *******四、管理IP及网关交换机的IP都会绑定在vlan上。
SNMP版本
Cisco IOS支持SNMP协议的下列版本:
SNMPv1 ·C 简单网络管理协议:一个完全的互联网标准,定义在
STD15/RFC1157(RFC1157文档替代了早期的RFC1098和RFC1067文档)和
STD16/RFC1155,RFC1212文档中。
安全机制采用基于团体字符串(Community String)认证方式。
SNMPv2c ·C 基于团体字符串认证管理框架的简单网络管理协议版本
2.SNMPv2c(c代表Community)是一个互联网实验标准,具体技术规范定义在RFC1901,RFC1905和RFC1906文档。
SNMPv2c在SNMPv2p(SNMPv2 Classic)基础上定义了协议操作和数据类型的更新,安全机制延续了SNMPv1的基于团体字符串认证方式。
SNMPv3 ·C 简单网络管理协议版本3,2002年3月被IESG(Internet Engineering Steering Group)批准为完全的互联网标准。
SNMPv3是一个具有互操作性的标准协议,核心规范定义在STD62/RFC3411到RFC3418文档中。
SNMPv3提供了设备安全访问机制,是由认证和网络传输中数据包加密的组合方式实现的。
SNMPv3提供的安全特性包括:
报文完整性·C 确保数据包在传输过程中没有被篡改
认证·C 确定报文是由正确信息源发送来的
加密·C 对报文内容进行加密,防止其被未经授权的读取
SNMPv1和SNMPv2c都利用了基于“团体(Community)”形式的安全认证机制。
能够访问SNMP代理MIB数据的管理者“团体”通过一个IP地址访问控制列表和口令进行定义。
SNMPv2c还增加了对大批量数据读取机制的支持和向管理工作站更加详细的错误消息汇报机制。
支持对大批量数据的读取机制能够用来对整个 MIB数据表格和大量的信息进行快速读取,减少请求/应答的往复数量。
SNMPv2c增强的错误处理机制包括扩展的错误代码,用于区别不同的错误状况。
错误返回代码现在将包括错误类型。
SNMPv3重点强调增强协议的安全认证/加密,授权/访问控制以及远程配置管理等功能,而在其它方面沿用了部分SNMPv2原有的技术规范。
SNMPv3提供了一个安全模型。
这个安全模型中可以为用户/用户组定义不同的安全认证策略;而安全级别是指SNMPv3安全模型中被允许的安全等级。
安全模型和安全等级的组合将会决定在处理一个SNMP数据包时采用的安全机制。
如果想了解SNMPv3的额外信息,可以参阅RFC3410文档《Introduction and Applicability Statements for Internet Standard Management Framework》
配置详解
管理员需要配置SNMP代理使用管理工作站支持的SNMP版本。
一个SNMP代理可以和多个SNMP管理者同时通信;因此你可以配置Cisco IOS软件与一个管理工作站通过SNMPv1通信,与第二个管理工作站通过SNMPv2c通信,同时与第三个管理工作站通过SNMPv3通信。
在IOS的Enable状态下,敲入
config terminal 进入全局配置状态
Cdp run 启用CDP
snmp-server community gsunion ro 配置本路由器的只读字串为gsunion
snmp-server community gsunion rw 配置本路由器的读写字串为gsunion
snmp-server enable traps 允许路由器将所有类型SNMP Trap发送出去
snmp-server host IP-address-server traps trapcomm 指定路由器SNMP Trap的接收者为10.238.18.17,发送Trap时采用trapcomm作为字串
snmp-server trap-source loopback0 将loopback接口的IP地址作为SNMP Trap的发送源地址
show running
copy running start或write terminal 显示并检查配置
保存配置
配置Cisco设备的SNMP代理
配置Cisco设备上的SNMP代理的步骤如下:
启用SNMP:
configure terminal
snmp-server community rw/ro (example: snmp-server community public ro)
end
copy running-configstartup-config
启用陷阱:
configure terminal
snmp-server enable traps snmp authentication
end
copy running-configstartup-config
配置snmp
#conf t
#snmp-server community cisco ro(只读);配置只读通信字符串#snmp-server community secret rw(读写);配置读写通信字符串#snmp-server enable traps ;配置网关SNMP TRAP
#snmp-server host 10.254.190.1 rw ;配置网关工作站地址。