AutomationGlobal Config

restconf

Enables the RESTCONF API on the device, allowing external applications to manage and monitor the device using RESTful HTTP/HTTPS requests.

Syntax·Global Config
restconf

When to Use This Command

  • Automating device configuration changes using a Python script that sends RESTCONF requests.
  • Integrating network devices with a centralized orchestration platform like Cisco DNA Center or Ansible.
  • Monitoring device health and interface statistics via RESTCONF GET requests from a monitoring system.
  • Performing bulk configuration backups by retrieving device configurations via RESTCONF.

Command Examples

Enable RESTCONF with default settings

restconf
Device(config)# restconf
Device(config-restconf)#

The 'restconf' command enters RESTCONF configuration mode. No additional output is shown; the prompt changes to indicate RESTCONF sub-mode.

Enable RESTCONF and specify HTTP/HTTPS transport

restconf transport https
Device(config)# restconf
Device(config-restconf)# transport https
Device(config-restconf)#

After entering RESTCONF mode, the 'transport https' command restricts RESTCONF to HTTPS only. The prompt remains in RESTCONF sub-mode.

Understanding the Output

The 'restconf' command itself does not produce verbose output. It simply enters RESTCONF configuration mode, indicated by the prompt change to '(config-restconf)#'. From this mode, you can configure transport protocols (HTTP/HTTPS), authentication, and other RESTCONF parameters. To verify that RESTCONF is enabled, use 'show running-config | include restconf' or 'show platform software restconf' (if available). A successful configuration will show 'restconf' in the running configuration. If RESTCONF is not enabled, the command will not appear. Ensure that the device has an HTTP/HTTPS server configured (e.g., 'ip http server' or 'ip http secure-server') for RESTCONF to function.

CCNA Exam Tips

1.

CCNA exam may ask which command enables RESTCONF; answer is 'restconf' in global config.

2.

Remember that RESTCONF requires an HTTP/HTTPS server to be enabled; 'ip http server' or 'ip http secure-server' must be configured.

3.

Know that RESTCONF uses YANG data models and is an alternative to NETCONF for programmatic access.

4.

Be aware that RESTCONF can use both HTTP and HTTPS, but HTTPS is recommended for security.

Common Mistakes

Forgetting to enable the HTTP/HTTPS server before using RESTCONF, causing connection failures.

Assuming RESTCONF works without configuring authentication; RESTCONF uses the device's AAA or local credentials.

Confusing RESTCONF with NETCONF; RESTCONF uses HTTP/HTTPS and JSON/XML, while NETCONF uses SSH and XML.

Related Commands

Practice for the CCNA 200-301

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

Practice CCNA Questions