Catalyst 9800 wireless lab 9 of 12

Automate it: RESTCONF and Python

Read the controller's WLANs and tags over RESTCONF in the browser and the terminal, create a WLAN with a JSON PATCH, finish it in the GUI, add it to a policy tag with the API and read a WLAN list with a short Python script.

Run this lab

It needs Lite: its 3 nodes are set to 6 vCPU and 5,632 MB in total. It is ready about 8 minutes after you start it. It starts already set up, with nothing to paste before the first task. It fits the free demo too.

In your workspace: Shared, then Catalyst 9800 wireless configuration guided labs, then 09 - Automate it - RESTCONF and Python

Try it free for 30 minutesRun it on Lite from £3 a day

  • About 8 min to be ready
  • About 45 min of tasks
  • The free demo’s 30 min cover the start and about 22 min of the tasks

The free demo needs no card and no email. Every lab plan includes every guided lab.

Level
Intermediate
How you work
GUI-led
Nodes need
6 vCPU, 5,632 MB
Smallest plan
Lite

The scenario

Kestrel is about to roll out the same set of WLANs to forty sites, and the network team wants it scripted rather than clicked. Before they write the scripts, you try the controller's RESTCONF API by hand: read the WLANs and tags, create the new IoT WLAN with the API, finish its security in the GUI, add it to the head-office policy tag with the API again, and see every change in both places.

DeviceInterfaceAddressRole
WLC1 (Catalyst 9800-CL, IOS XE 17.12.2)Vlan10 on Gi2 (trunk, native VLAN 10)10.80.10.5/24wireless management interface: GUI, SSH, RESTCONF
DESKTOPeth010.80.10.50/24your workstation: Firefox, terminal, ssh, curl, Python
SVCeth010.80.10.20/24lab services: RADIUS (FreeRADIUS), DNS, syslog, NTP

Already in place: KESTREL-STAFF, KESTREL-CORP, the RADIUS settings, STAFF-POLICY and HQ-POLICY-TAG (lab 05), and lab 02's management services. RESTCONF is on (restconf in the start state) and uses the same admin account as the GUI. DESKTOP has a small helper, restconf, that signs in as admin and prints the HTTP status and the reply: restconf get PATH, restconf patch PATH FILE.json. Your work folder on DESKTOP is /root/lab.

What this lab can and can't show. There are no access points, no radios and no wireless clients in these labs: the C9800-CL runs as a controller on its own. Everything you build is real controller configuration, the same objects a live network uses, and the controller shows it as up and enabled, but no SSID goes on air and no client joins. Where a task would normally end with a client connecting, it ends with the controller's own view of the setting instead.

Skills: RESTCONF URLs and YANG models, GET and PATCH with JSON, reading configuration and operational data, mixing API and GUI changes.

What you’ll practise

  • Read 9800 configuration and operational data over RESTCONF
  • Create and change wireless objects with RESTCONF PATCH and JSON
  • Combine API and GUI changes on the same objects

The tasks

  • Start the lab
  • Task 1: Read the WLANs in the browser
  • Task 2: Read configuration and state from the terminal
  • Task 3: Create the IoT WLAN with the API
  • Task 4: Finish it in the GUI
  • Task 5: Add it to the policy tag with the API
  • Going further: the same in Python
  • What's next

The Lab Tasks pane has the scenario, these tasks, the checks to run, hints and the full solution.

Topology and devices

The network as it opens in EVE-NG, drawn from the lab’s own canvas, and the image each node runs.

Topology of Automate it - RESTCONF and Python3 nodes and 1 network, 3 links. Every link is listed as text below the diagram.WLC1DESKTOPSVCMGMTGi2eth0eth0
3 nodes and 1 network, with the interface names each link uses. On a narrow screen, scroll the diagram sideways.
Nodes in Automate it: RESTCONF and Python, with the image each runs and the vCPU and RAM it’s set to
NodeDeviceImage in Add NodeSet to
WLC1Cisco Catalyst 9800-CLc9800cl-17.12.024 vCPU, 4,096 MB
DESKTOPCloudLabBox desktop (Docker)CloudLabBox’s own desktop image1 vCPU, 1,024 MB
SVCCloudLabBox lab services host (Docker)CloudLabBox’s own services image (DNS, RADIUS, TACACS+, SSH and more)1 vCPU, 512 MB

How to open this lab

  1. Sign in to your workspace at lab.cloudlabbox.com.

  2. In File Manager, open Shared, then the folder Catalyst 9800 wireless configuration guided labs.

  3. Open 09 - Automate it - RESTCONF and Python and start its nodes, then open Lab Tasks for the scenario and the steps.

  4. For the controller’s web GUI, work from the lab’s desktop, DESKTOP: open its console, maximise the window and open the controller’s address in Firefox.

The lab is read-only. You can start the nodes and configure the devices, but changes to the topology can’t be saved. To change it, rebuild it in your own folder.

More Catalyst 9800 wireless labs

All Catalyst 9800 wireless labs

Related labs in other courses

CloudLabBox is independent of Cisco. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.