Courseiva
SystemGlobal Config

snmp-server host [ip] [string]

Configures the SNMP server to send SNMP notifications (traps or informs) to a specified host, using a community string for authentication.

Definition: snmp-server host [ip] [string] is a Cisco IOS global config command. Configures the SNMP server to send SNMP notifications (traps or informs) to a specified host, using a community string for authentication.

Overview

The `snmp-server host` command is a fundamental configuration directive in Cisco IOS that enables a network device to send SNMP notifications—either traps or informs—to a designated management station. SNMP (Simple Network Management Protocol) is the backbone of network monitoring, allowing administrators to collect performance data, detect faults, and receive alerts about critical events such as interface flaps, CPU spikes, or authentication failures. By directing notifications to a specific host, this command ensures that the right personnel or monitoring system receives timely information about network health.

This command is typically used in conjunction with `snmp-server enable traps` to specify which types of events trigger notifications. Without it, the device would not send any traps, even if trap generation is enabled. The command requires a community string, which acts as a simple password for authentication, though in production environments, SNMPv3 with encryption and authentication is preferred.

The command is entered in global configuration mode and takes effect immediately, adding the host to the running configuration. It is important to note that multiple `snmp-server host` commands can be issued to send notifications to multiple management stations, each potentially with different community strings or SNMP versions. The command does not affect the device's performance significantly, but excessive trap generation can overwhelm the management station or the network link.

When troubleshooting, verifying that the host is correctly configured and that the management station is reachable is essential. This command is a cornerstone of proactive network management, enabling rapid response to incidents and reducing mean time to repair (MTTR). It fits into the broader workflow of configuring SNMP: first, define the SNMP community or user; second, enable the desired traps; third, specify the target host(s); and finally, verify reachability and trap reception.

Alternatives include using SNMPv3 with security features or sending traps to a trap receiver via a VPN. In summary, `snmp-server host` is a simple yet powerful command that bridges the device's internal event system with external monitoring solutions, making it indispensable for any network engineer managing Cisco devices.

Syntax·Global Config
snmp-server host [ip] [string]

When to Use This Command

  • Sending SNMP traps to a network management system (NMS) like SolarWinds or PRTG for monitoring device health.
  • Forwarding authentication failure traps to a security information and event management (SIEM) system.
  • Configuring redundant SNMP notification destinations by specifying multiple hosts.
  • Sending interface status change traps to a help desk ticketing system.

Parameters

ParameterSyntaxDescription
ipA.B.C.DThe IP address of the SNMP management station (trap receiver) that will receive the notifications. This can be any valid IPv4 address, typically in a private range like 10.0.0.0/8 or 192.168.0.0/16. A common mistake is using an unreachable IP or forgetting to ensure IP connectivity between the device and the management station.
stringWORD (1-255 characters)The SNMP community string used for authentication when sending traps. This acts as a shared secret between the device and the management station. For SNMPv1 or v2c, the community string is sent in clear text, so it should be treated as a password. Common mistakes include using the default 'public' or 'private', which are security risks, or mismatching the community string between the device and the management station.

Command Examples

Basic SNMP trap host configuration

snmp-server host 192.168.1.100 public

No output is generated upon successful configuration. The command configures the router to send SNMP traps to host 192.168.1.100 using community string 'public'.

Verifying SNMP host configuration

show snmp host
Notification host: 192.168.1.100   udp-port: 162   type: trap
   user: public   security model: v1
Notification host: 10.0.0.50   udp-port: 162   type: trap
   user: snmpadmin   security model: v2c

The output lists each configured SNMP notification host. 'Notification host' is the IP address of the NMS. 'udp-port' is the destination port (default 162). 'type' indicates trap or inform. 'user' shows the community string (v1/v2c) or username (v3). 'security model' shows SNMP version.

Understanding the Output

The 'show snmp host' command displays all configured SNMP notification destinations. Each host entry shows the IP address, UDP port (default 162), notification type (trap or inform), community string or username, and SNMP security model (v1, v2c, or v3). In a real network, you should verify that the NMS IP is correct and that the community string matches the NMS configuration.

Missing hosts or incorrect community strings will prevent trap delivery. Watch for 'type: inform' if you configured informs instead of traps.

Configuration Scenarios

Send SNMPv2c Traps to a Central Monitoring Server

A network administrator needs to configure a Cisco router to send SNMPv2c traps to a central monitoring server at 192.168.1.100 using the community string 'CourseivaMon'. The router should send traps for interface state changes and CPU usage.

Topology

R1(Gi0/0)---192.168.1.0/24---(eth0)MonitoringServer

Steps

  1. 1.Step 1: Enter global configuration mode: Router> enable then Router# configure terminal
  2. 2.Step 2: Set the SNMP community string (read-only or read-write): Router(config)# snmp-server community CourseivaMon RO
  3. 3.Step 3: Enable traps for interface and CPU events: Router(config)# snmp-server enable traps snmp linkdown linkup; Router(config)# snmp-server enable traps cpu
  4. 4.Step 4: Specify the trap receiver: Router(config)# snmp-server host 192.168.1.100 CourseivaMon
  5. 5.Step 5: Exit configuration mode and save: Router(config)# end; Router# write memory
Configuration
!
Router(config)# snmp-server community CourseivaMon RO
Router(config)# snmp-server enable traps snmp linkdown linkup
Router(config)# snmp-server enable traps cpu
Router(config)# snmp-server host 192.168.1.100 CourseivaMon
!

Verify: Use 'show running-config | include snmp-server host' to confirm the host entry. Use 'show snmp host' to display all configured trap receivers. Expected output includes the IP address and community string. To verify traps are being sent, use 'debug snmp packets' on the router (with caution) or check the monitoring server for received traps.

Watch out: If the monitoring server is not receiving traps, ensure that the community string matches exactly and that UDP port 162 is not blocked by any firewall between the router and the server. Also, verify that the router can reach the server (ping 192.168.1.100).

Configure SNMPv3 Informs to a Secure Management Station

A security-conscious organization requires encrypted SNMP notifications. The network engineer must configure a Cisco switch to send SNMPv3 informs (acknowledged notifications) to a management station at 10.0.0.50 using a user with authentication and privacy.

Topology

SW1(Vlan1)---10.0.0.0/24---(eth0)MgmtStation

Steps

  1. 1.Step 1: Enter global configuration mode: Switch> enable then Switch# configure terminal
  2. 2.Step 2: Create an SNMPv3 user with authentication (MD5) and privacy (DES): Switch(config)# snmp-server user admin CourseivaGroup v3 auth md5 AuthPass123 priv des PrivPass456
  3. 3.Step 3: Define the SNMP group and associate with the user: Switch(config)# snmp-server group CourseivaGroup v3 priv
  4. 4.Step 4: Enable informs (instead of traps) and specify the host: Switch(config)# snmp-server host 10.0.0.50 informs version 3 priv admin
  5. 5.Step 5: Enable the desired traps: Switch(config)# snmp-server enable traps
  6. 6.Step 6: Exit and save: Switch(config)# end; Switch# copy running-config startup-config
Configuration
!
Switch(config)# snmp-server user admin CourseivaGroup v3 auth md5 AuthPass123 priv des PrivPass456
Switch(config)# snmp-server group CourseivaGroup v3 priv
Switch(config)# snmp-server host 10.0.0.50 informs version 3 priv admin
Switch(config)# snmp-server enable traps
!

Verify: Use 'show snmp user' to verify the user exists. Use 'show snmp host' to see the host configuration with version 3 and informs. To test, trigger a trap (e.g., shut/no shut an interface) and check the management station for received informs. The management station must be configured with the same user credentials.

Watch out: SNMPv3 informs require that the management station's clock is synchronized (via NTP) with the switch, as timestamps are used for authentication. Also, ensure that the management station supports SNMPv3 informs and has the same user credentials configured.

Troubleshooting with This Command

When troubleshooting SNMP notification delivery, the first step is to verify that the `snmp-server host` command is correctly configured. Use `show running-config | include snmp-server host` to confirm the IP address, community string, and version. If the host appears, check reachability with `ping` from the device to the management station.

If ping fails, investigate routing issues or ACLs blocking ICMP. Next, ensure that the management station is listening on UDP port 162. On the device, use `show snmp` to see global SNMP statistics, including the number of traps sent and failed.

A high number of failed sends indicates connectivity or authentication problems. Use `debug snmp packets` with caution in a lab environment to see if traps are being generated and sent. The debug output shows the packet being sent and any errors.

Common symptoms include: no traps received at the management station—check community string mismatch; traps received but not processed—verify that the management station's SNMP service is running; intermittent traps—check for network congestion or high CPU on the device. Also, correlate with `show logging` to see if any SNMP-related errors appear. If using SNMPv3, verify user configuration with `show snmp user` and ensure the management station has the same credentials.

For informs, check that the device is configured to wait for acknowledgment; if the management station is unreachable, the device may queue informs and eventually drop them. Use `show snmp pending` to see pending informs. Finally, review the trap enable commands: `snmp-server enable traps` without specific keywords enables all traps, which may overwhelm the management station.

Use targeted enables for specific events. In summary, a systematic approach—verifying configuration, connectivity, authentication, and trap generation—will isolate most issues.

CCNA Exam Tips

1.

CCNA exam expects you to know that 'snmp-server host' is used to specify the destination for traps, while 'snmp-server enable traps' globally enables trap generation.

2.

Remember that the community string acts like a password; the NMS must use the same string to receive traps.

3.

The default SNMP version is v1 unless specified; exam may test how to configure v2c or v3.

4.

You can configure multiple hosts by repeating the command with different IPs.

Common Mistakes

Forgetting to enable traps globally with 'snmp-server enable traps' — without it, no traps are sent even if hosts are configured.

Using a community string that doesn't match the NMS configuration, causing authentication failures.

Omitting the SNMP version; default v1 may not be supported by modern NMS, leading to no trap reception.

snmp-server host [ip] [string] vs snmp-server enable traps

Both commands are essential for SNMP trap configuration, but they serve different purposes: one enables trap generation globally, while the other specifies where to send those traps. They are often confused because both are required for traps to function correctly.

Aspectsnmp-server host [ip] [string]snmp-server enable traps
ScopeSpecifies a destination host and community for notificationsEnables trap generation for all supported events globally
Configuration modeGlobal configurationGlobal configuration
PersistenceSaved in running-config; persists across reboots if saved to startup-configSaved in running-config; persists across reboots if saved to startup-config
PrecedenceRequires trap generation to be enabled (via 'snmp-server enable traps') to send trapsMust be configured for any trap notifications to be sent
Typical useDirecting alerts to an SNMP management stationActivating SNMP trap notifications for monitoring
EffectDefines where and how notifications are sent (community string, UDP port, version)Enables the device to generate SNMP traps for configured events

Use snmp-server host [ip] [string] when you need to send SNMP notifications to a specific management station with a community string for authentication.

Use snmp-server enable traps when you need to enable the device to generate and send SNMP trap notifications for events like interface changes or authentication failures.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 switches), the `snmp-server host` command syntax is identical to classic IOS. However, IOS-XE supports additional parameters like `udp-port` to specify a non-default port. For example: `snmp-server host 192.168.1.100 version 2c CourseivaMon udp-port 10162`.

The output of `show snmp host` may include an `EngineID` field for SNMPv3. In NX-OS (Cisco Nexus switches), the equivalent command is `snmp-server host [ip] traps version [1|2c|3] [community]`. NX-OS also uses `snmp-server user` for SNMPv3 but with different syntax: `snmp-server user [user] [group] auth [md5|sha] [password] priv [des|aes] [password]`.

For ASA firewalls, the command is `snmp-server host [interface_name] [ip] [community]` and traps are enabled with `snmp-server enable traps`. ASA does not support SNMPv3 traps in all versions. In IOS-XR, the command is `snmp-server host [ip] [community]` but requires the `traps` keyword: `snmp-server host 10.0.0.50 traps version 2c CourseivaMon`.

IOS-XR also uses `snmp-server community` and `snmp-server user` with different syntax. Overall, while the core concept remains, platform-specific nuances in syntax and available features must be considered.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions