CISCO router & switch SNMPv2 configuration, cisco Router
Cisco router SNMP Configuration
Snmp-server community CQGASPZW-R RO // ro read-only
Snmp-server trap-source Loopback0 // use the loopbackaddress as the source address of the message sent by the trap.
Snmp-server host 50.1.50.3 version 2c CQGASPZW-R udp-port 9006 // configure the SNMP server IP address, SNMP version number, community string CQGASPZW-R, port number 9006
#### What message to trap is configured according to the engineering environment requirements ############
Snmp-server enable traps snmp linkdown linkup // Send Port up and down messages to the snmp server
Snmp-server enable traps syslog // sends system information to the snmp server
Snmp-server enable traps cpu threshold // send threshold information to the SNMP server
######################################## ################
Cisco switch SNMP Configuration
Snmp-server source-no snmp trap link-status interface trap loopback0
Snmp-server host 50.1.50.3 traps version 2c CQGASPZW-R udp-port 9006
#### Configure the following command for the nexus7000 series ########
Snmp-server host 50.1.50.3 use-vrf default udp-port 9006 // The default port is the Management port of the Engine board to send packets. You need to configure this command when sending packets to the business line interface.
Cisco (config) # int e1/1
Cisco (config-if) # no snmp trap link-status // ignore the up-down information of the port, not trap to the server
Note: Many SNMP commands on the vswitch are configured by default. sh run all | include snmp is required to view the corresponding configuration and select the appropriate trap information.