CDRouter can display SNMP traps using both the -decode option and the -pt (or -ptc) option. To create a trap receiver, configure a staticHost entry for the trap receiver that is configured on the device.
For example, if the device was configured to send traps to 192.168.1.254, the following would be added to your CDRouter configuration file:
testvar staticHost 192.168.1.254
CDRouter will answer any ARP requests for staticHost entries, allowing the SNMP trap to be sent. With the -decode option, the SNMP trap message will be displayed in the packet decode. With the -pt option, the trap message will be logged.
NOTE: The IP address for a staticHost must be on the same subnet as the LAN configuration (testvar lanIp).
PACKET-IN(eth1): received eth proto type 0800 ETH: ---- Ethernet Packet (length = 171) ---- ETH: ETH: Source = 00:06:25:c2:1e:31 ETH: Destination = 00:c0:95:e0:2f:f0 ETH: Type = IPv4 (0x0800) ETH: IPv4: ---- IPv4 Header ---- IPv4: IPv4: Version = 4 IPv4: Header Length = 5 IPv4: TOS byte = 0x00 IPv4: Total Length = 157 IPv4: ID = 0x0000 IPv4: Flags/Offset = 0x0000 IPv4: Don't Fragment = 0 IPv4: More Fragments = 0 IPv4: Offset = 0 IPv4: TTL = 150 IPv4: Protocol = UDP (0x11) IPv4: Checksum = 0xa000 IPv4: Src = 192.168.1.1 IPv4: Dest = 192.168.1.254 IPv4: UDP: ---- UDP Packet ---- UDP: UDP: Source Port = 1050 UDP: Destination Port = 162 (SNMP Trap) UDP: Length = 137 UDP: Checksum = 0xcb27 UDP: SNMP: ---- SNMP Trap Packet ---- SNMP: SNMP: 192.168.1.1TRAP, SNMP v1, community SNMP: .1.3.6.1.4.1.3955.2.2.1 Enterprise Specific Trap (1) Uptime: 0:01:18.44 SNMP: .1.3.6.1.4.1.3955.1.1.0 = STRING: "@in UDP from 192.168.200.254:5000 to 192.168.200.2:1201." SNMP: SNMP: SNMP: ---- End SNMP Trap Packet ----