Category: Various

CML 2.7 – Getting started with APIs using Postman

Cisco Modeling Labs 2.7

Cisco Modeling Labs (CML) is a powerful, scalable network simulation platform that enables network engineers, IT administrators, and developers to design, build, and test networks in a controlled environment. The latest version, Cisco Modeling Labs 2.7, introduces new features and enhancements, including an improved REST API that enables seamless automation and integration. In this article, we’ll discuss how to get started with CML 2.7 and use Postman to interact with its API for network automation tasks.

CML API Documentation

Log in to Cisco Modeling Labs: Go to the CML web interface, typically accessed via your browser.

Find API Documentation: CML’s built-in documentation is available under Help > API Documentation. This provides detailed information on available API endpoints, request formats, and expected responses.

A new page will open with the documentation:

Here you can find all the information on the available CML API calls that you might need. 

(more…)

CML 2.7 – Adding the IOS-XRv image

Cisco Modeling Labs 2.7

As of Cisco Modeling Labs (CML) version 2.7, the standard IOS-XRv image has limited support and fewer features compared to the newer IOS-XRv 9000 image, which is the preferred option for IOS XR simulations in CML. The IOS-XRv image is not included in the refplat ISO and the only option available after a fresh CML 2.7 install is XRV9K. 

The IOS-XRv 9000 image includes more robust MPLS and VRF capabilities, such as successful L3 MPLS VPN implementations, making it a better choice for complex routing scenarios. However, the IOS-XRv image itself remains available with limitations, including a lack of L2 MPLS VPN support in certain scenarios.

XRv vs XRv9K resources

The only challenge with the IOS-XRv 9000 image is that it requires slightly more resources than the IOS-XRv image.

(more…)

CML 2.7 – Getting started with Cisco Modeling Labs v2.7

Last weekend I decided to try Cisco’s Modeling Labs (CML). This is Cisco’s network virtualization platform comparable to GNS3 or EVE-NG. It replaced an older Cisco product called VIRL (Virtual Internet Routing Lab), offering more features and improved performance.
I have quite a lot of experience with both EVE-NG and GNS3, so I’m curious to see how CML will compare.

In this article we go over the following steps:

Getting started

I went with the option of installing CML on my ESXi server.
This installation will cover a fresh install on VMware ESXi using the CML .OVA file. 
Some useful links before we get started:

CML information:
https://www.cisco.com/c/en/us/products/cloud-systems-management/modeling-labs/index.html

CML Licensing:
https://learningnetworkstore.cisco.com/cisco-modeling-labs-personal/cisco-modeling-labs-personal/CML-PERSONAL.html

Software download:
https://software.cisco.com/download/home/286290254/type/286290305/release/CML-Personal%202.7.2

We start by downloading two files from the software website. We need both of these for the install.

    1. The server installation file (either the OVA of the ISO).
    2. The reference platform ISO (this contains the router images that are used in CML).

(more…)

[QoL] Uploading files to Cisco TAC via CXD

Uploading files to a Cisco TAC case.

Have you ever needed to upload large (log)files from an appliance to a Cisco TAC?

Troubleshooting DNA-Center for example usually involves creating Root Cause Analysis (RCA) files which can be well over 1GB. After generating the files we have to copy them from the controller and either mail them to the case, or upload them via the webinterface with the Case File Uploader. Both of these options require additional steps of copying and transferring. 

Customer eXperience Drive.

There is an easier way to upload the files directly from the controller using the Customer eXperience Drive (CXD).

The Customer eXperience Drive (CXD) is a multi-protocol file upload service with no limitation on the uploaded file size. It allows Cisco customers with active Service Requests (SRs) to upload data directly to a case using a unique set of credentials created per SR. The protocols supported by CXD are natively supported by Cisco products which allows for uploading directly from Cisco devices to SRs.

You will need the following things;

  • Service Request Number
  • CXD Token

To generate the CXD Token complete these steps:

Step 1   Log in to SCM.
Step 2   Open the case you would like to get the upload token for.
Step 3   Click the Attachments tab.
Step 4   Click Generate Token. Once the token is generated it will be displayed next to the Generate Token button.

Uploading files using CURL

Once we have the SR number (SR60000000) and the token (aaaabbbbccccdddd) we can use that to upload directly from a controller. We can transfer the file with our SR credentials to https://cxd.cisco.com/home/ and the file will be automatically added to the case.

CURL without a proxy:

  • curl -T “[path/to/file]/[file]” -u 60000000:aaaabbbbccccdddd https://cxd.cisco.com/home/

CURL with a proxy:

  • curl -T “[path/to/file]/[file]” -x http://[proxy:8080] -u 60000000:aaaabbbbccccdddd https://cxd.cisco.com/home/

Sample Python Code to use the PUT API

Note that the following code assumes the file is stored in the same path you are running it from.

import requests
from requests.auth import HTTPBasicAuth
url = 'https://cxd.cisco.com/home/'
username = 'SR Number'
password = 'Upload Token'
auth = HTTPBasicAuth(username, password)
filename = 'showtech.txt'
f = open(filename, 'rb')
r = requests.put(url + filename, f, auth=auth, verify=False)
r.close()
f.close()
if r.status_code == 201:
    print("File Uploaded Successfully")

Enjoy your no limit uploads!