SystemGlobal Config

snmp-server location [text]

Sets a descriptive location string for the SNMP agent, used to identify the physical location of the device in network management systems.

Syntax·Global Config
snmp-server location [text]

When to Use This Command

  • Assigning a location string like 'Building A, Floor 3, Rack 12' to a router for easy identification in SNMP management tools.
  • Updating the location field after moving a device to a new data center or rack.
  • Setting location information for compliance with network inventory standards.
  • Providing location context for automated monitoring systems that alert based on device location.

Command Examples

Setting a location string

Router(config)# snmp-server location Building A, Floor 3, Rack 12
Router(config)#

No output is displayed upon successful configuration. The command simply sets the location string in the running configuration.

Verifying the location setting

Router# show running-config | include snmp-server location
snmp-server location Building A, Floor 3, Rack 12

The output shows the configured location string. If no location is set, this line will not appear.

Understanding the Output

The command does not produce direct output. To verify the location, use 'show running-config | include snmp-server location'. The output shows the exact string configured. If the line is missing, no location is set. In SNMP, the location is stored in the MIB variable sysLocation (OID 1.3.6.1.2.1.1.6.0). Network management tools can query this value to display device location. A good value is a descriptive string; a bad value is empty or misleading.

CCNA Exam Tips

1.

Remember that 'snmp-server location' is a global config command and does not require an SNMP community to be set first.

2.

The location string can be up to 255 characters; the exam may test that you know it's a text string, not an IP address.

3.

Be aware that 'show snmp location' is not a valid command; use 'show running-config' or 'show snmp' to verify.

4.

The location is part of SNMPv1/v2c MIB-II; it is read-only via SNMP but set via CLI.

Common Mistakes

Forgetting to enclose the location string in quotes if it contains spaces; actually quotes are not required, but spaces are allowed without quotes.

Using the command in interface configuration mode instead of global configuration mode.

Confusing 'snmp-server location' with 'snmp-server contact' which sets the contact person.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions