snmp-server host

Configures the agent with the SNMP trap destination information with the community attached to it.

Syntax

snmp-server hostip-address community-string {udp-port version[1,2c ] }
no snmp-server hostip-address community-string {udp-port version[1,2c] }

Parameters

ip-address
SNMP trap receiver IP address in the format of a valid IPv4 address.
community-string
Community string associated with SNMP traps. Valid length is 2 through 16 characters.
udp-port
Port on which the receiver is listening for SNMP traps. Default port is 162.
version
SNMP version to be used to send SNMP traps. Valid version is version 1 or version 2c, Default is version 2c.

Modes

Config mode

Usage Guidelines

You must have the admin role to perform this task.

This command combines a host and community string.

For a given host/community combination, you can enable either v1 or v2 SNMP traps.

Examples

The following example configures the SNMP server with the community string using version 2c.

device# configure terminal
device(config)# snmp-server host 10.23.17.128 public 162 version 2c 

The following example removes the configured host and community string.

device# configure terminal
device(config)# no snmp-server host 10.23.17.128 public