1. Log in to the switch using SSH
2. Configure snmp and snmptrap
conf t //Enter configuration mode
(config)# snmp-server enable traps //Enable snmptrap
(config)# snmp-server community public ro //Configure snmp read-only community name public
(config)# snmp-server host 192.168.1.1 traps version 2c trappublic udp- port 162 //Configure snmptrap community name (trappublic), trap receiving server address (192.168.1.1), trap receiving server port (162)
(config)# exit //Exit configuration mode
copy running-config startup-config //Save the configuration
SNMP test results
Before configuring the trap, log in to the Trap receiving server address with SSH, and enter the udp information monitoring command:
tcpdump -nn "udp" and host The IP
command format of the Cisco optical communication machine is: tcpdump -nn "udp" and host Device IP
test snmptrap, view On the trap receiving server, you can see a message with the word "Trap" appearing, indicating successful
technical exchange. Welcome to join the Q group: 177428068