The content in this post is intended for educational and informational purposes only. All software rights belong to their respective owners.

Cisco recently made the IOS on Linux (IOL) images available through the Cisco Modeling Labs (CML) Free Tier . IOL is an implementation of Cisco IOS-XE that operates as an executable binary on Linux. This post will guide you through the process of creating Cisco IOL container images using Containerlab on macOS.

Prerequisite

macOS

  1. Point your web browser to the CML Software Download page.

  2. Click the Download icon for Cisco Modeling Labs reference platform ISO file (October 2024).

Download REFPLAT iso
  1. Log in with your Cisco.com (CCO ID) credentials when prompted.

  2. Save the refplat-20241016-freetier-iso.zip file to your Downloads folder.

  3. Open your favorite terminal emulator, and change to the Downloads directory.

cd ~/Downloads
  1. Create the cml28-refplat directory.
mkdir -p cml28-refplat
  1. Uncompress the refplat-20241016-freetier-iso.zip file into the cml28-refplatdirectory.
unzip refplat-20241016-freetier-iso.zip -d cml28-refplat
  1. Attach the refplat-20241016-freetier.iso file.
open cml28-refplat/refplat-20241016-freetier.iso
  1. Copy the IOL L2 image to the images directory on the clab Linux machine.
orb push -m clab /Volumes/REFPLAT/virl-base-images/ioll2-xe-17-15-01/x86_64_crb_linux_l2-adventerprisek9-ms.iol ~/images/
  1. Copy the IOL image to the images directory on the clab Linux machine.
orb push -m clab /Volumes/REFPLAT/virl-base-images/iol-xe-17-15-01/x86_64_crb_linux-adventerprisek9-ms.iol ~/images/
  1. Detach the refplat-20241016-freetier.iso file from Finder.
Detach REFPLAT iso

Containerlab

  1. Log in to the clab Linux machine.
orb -m clab
  1. Change to the images directory.
cd ~/images
  1. Clone the hellt/vrnetlab repo from GitHub.
git clone https://github.com/hellt/vrnetlab.git
  1. Copy (and rename) the IOL L2 image to the iol directory.
cp x86_64_crb_linux_l2-adventerprisek9-ms.iol vrnetlab/cisco/iol/cisco_iol-L2-17.15.01.bin
  1. Copy (and rename) the IOL image to the same iol directory.
cp x86_64_crb_linux-adventerprisek9-ms.iol vrnetlab/cisco/iol/cisco_iol-17.15.01.bin
  1. Change to the iol directory.
cd vrnetlab/cisco/iol
  1. Build the Cisco IOL container images.
DOCKER_DEFAULT_PLATFORM=linux/amd64 make docker-image
  1. Verify the Cisco IOL container images are now listed.
docker images vrnetlab/cisco_iol

output:

REPOSITORY           TAG           IMAGE ID       CREATED         SIZE
vrnetlab/cisco_iol   L2-17.15.01   4a8722ba46cb   5 seconds ago   613MB
vrnetlab/cisco_iol   17.15.01      45a779babe46   6 seconds ago   710MB

Lab

  1. Change to the iol directory.
cd ~/labs/iol
  1. Deploy the lab.
clab deploy

output:

INFO[0000] Containerlab v0.64.0 started
INFO[0000] Parsing & checking topology file: iol.clab.yml
INFO[0000] Creating docker network: Name="clab", IPv4Subnet="172.20.20.0/24", IPv6Subnet="3fff:172:20:20::/64", MTU=1500
INFO[0000] Creating lab directory: /home/marc/labs/iol/clab-iol
INFO[0000] Creating container: "r1"
INFO[0000] Creating container: "sw1"
INFO[0000] Running postdeploy actions for Cisco IOL 'sw1' node
INFO[0000] Created link: r1:eth1 (e0/1) <--> sw1:eth1 (e0/1)
INFO[0000] Running postdeploy actions for Cisco IOL 'r1' node
INFO[0000] Adding containerlab host entries to /etc/hosts file
INFO[0000] Adding ssh config for containerlab nodes
╭──────────────┬────────────────────────────────┬─────────┬───────────────────╮
│     Name     │           Kind/Image           │  State  │   IPv4/6 Address  │
├──────────────┼────────────────────────────────┼─────────┼───────────────────┤
│ clab-iol-r1  │ cisco_iol                      │ running │ 172.20.20.2       │
│              │ vrnetlab/cisco_iol:17.15.01    │         │ 3fff:172:20:20::2 │
├──────────────┼────────────────────────────────┼─────────┼───────────────────┤
│ clab-iol-sw1 │ cisco_iol                      │ running │ 172.20.20.3       │
│              │ vrnetlab/cisco_iol:L2-17.15.01 │         │ 3fff:172:20:20::3 │
╰──────────────┴────────────────────────────────┴─────────┴───────────────────╯
  1. Test SSH connectivity to the management interface of each node.

Give the nodes some time to complete the Cisco boot process.

for i in r sw; do sshpass -padmin ssh clab-iol-${i}1 'show version | in Ver'; done
  1. Destroy the lab.
clab destroy -c