Purchase

https://learningnetworkstore.cisco.com/cisco-modeling-labs-personal/

Download

https://learningnetworkstore.cisco.com → My Account → My Orders → Click Download → Redirected to https://software.cisco.com

  • cml2_p_2.7.1-20_amd64-25-iso.zip (1515.70 MB)
  • cml2_p_2.7.1-20_amd64-25.ova (893.48 MB)
  • refplat_p-20240623-fcs-iso.zip (11643.11 MB)

Install

Import cml2_xxx.ova to your hypervisor

Configure network

Access Cockpit Web - https://<YOUR_IP>:9090/

Patch

firewalld

CML2 uses firewalld as firewall.

/etc/firewalld/zones/trusted.xml
<?xml version="1.0" encoding="utf-8"?>
<zone target="ACCEPT">
  <short>Trusted</short>
  <source address="192.168.0.0/24"/>
  <service name="ssh"/>
  <service name="dhcpv6-client"/>
  <service name="http"/>
  <service name="https"/>
  <port port="1122" protocol="tcp"/>
  <port port="2222" protocol="tcp"/> 
  <port port="9090" protocol="tcp"/>
</zone>
# vi /etc/firewalld/zones/public.xml
# vi /etc/firewalld/zones/trusted.xml
# firewall-cmd --reload
# firewall-cmd --get-active-zones
public
  interfaces: bridge0 enp1s0
trusted
  sources: 192.168.0.0/24

sshd

# vi /etc/ssh/sshd_config
Port 2222

# vi /etc/passwd
root:x:0:0:root:/root:/bin/bash

# mkdir -p /root/.ssh
# chmod 700 /root/.ssh
# touch /root/.ssh/authorized_keys
# chmod 600 /root/.ssh/authorized_keys
# vi /root/.ssh/authorized_keys
Add your ssh pubkey

# systemctl enable --now ssh

qemu-guest-agent

# apt update
# apt install qemu-guest-agent
# systemctl start qemu-guest-agent
# systemctl enable qemu-guest-agent.service

Expand Disk

Expand disk on hypervisor, then following commands

# lsblk
NAME             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                8:0    0   60G  0 disk
├─sda1             8:1    0  512M  0 part /boot/efi
└─sda2             8:2    0 31.5G  0 part
  ├─vg00-lv_root 253:0    0   10G  0 lvm  /
  └─vg00-lv_var  253:1    0 21.5G  0 lvm  /var

# growpart /dev/sda 2
CHANGED: partition=2 start=1050624 old: size=66058207 end=67108831 new: size=124778463 end=125829087

# lsblk /dev/sda2
NAME           MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda2             8:2    0 59.5G  0 part
├─vg00-lv_root 253:0    0   10G  0 lvm  /
└─vg00-lv_var  253:1    0 21.5G  0 lvm  /var

# pvresize /dev/sda2
  Physical volume "/dev/sda2" changed
  1 physical volume(s) resized or updated

# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg00
  PV Size               <59.50 GiB / not usable 1.98 MiB

# lvextend -l +100%FREE /dev/vg00/lv_var
  Size of logical volume vg00/lv_var changed from <21.50 GiB (5503 extents) to <49.50 GiB (12671 extents).
  Logical volume vg00/lv_var successfully resized.

# resize2fs /dev/vg00/lv_var
Filesystem at /dev/vg00/lv_var is mounted on /var; on-line resizing required
old_desc_blocks = 3, new_desc_blocks = 7
The filesystem on /dev/vg00/lv_var is now 12975104 (4k) blocks long.

# df -h /var
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/vg00-lv_var   49G   17G   31G  35% /var

Import Images from refplat ISO ⭐

refplat iso : 13GB of Virtual Appliacnes

# tree /Volumes/REFPLAT
/Volumes/REFPLAT
├── node-definitions
│   ├── alpine-trex.yaml
│   ├── alpine-wanem.yaml
│   ├── alpine.yaml
│   ├── asav.yaml
│   ├── cat8000v.yaml
│   ├── cat9000v-q200.yaml
│   ├── cat9000v-uadp.yaml
│   ├── csr1000v.yaml
│   ├── desktop.yaml
│   ├── iol-xe.yaml
│   ├── ioll2-xe.yaml
│   ├── iosv.yaml
│   ├── iosvl2.yaml
│   ├── iosxrv9000.yaml
│   ├── nxosv9000.yaml
│   ├── server.yaml
│   └── ubuntu.yaml
└── virl-base-images
    ├── alpine-base-3-19-1
    │   ├── alpine-base-3-19-1.qcow2
    │   └── alpine-base-3-19-1.yaml
    ├── alpine-desktop-3-19-1
    │   ├── alpine-desktop-3-19-1.qcow2
    │   └── alpine-desktop-3-19-1.yaml
    ├── alpine-trex-3-19-1
    │   ├── alpine-trex-3-19-1.qcow2
    │   └── alpine-trex-3-19-1.yaml
    ├── alpine-wanem-3-19-1
    │   ├── alpine-wanem-3-19-1.qcow2
    │   └── alpine-wanem-3-19-1.yaml
    ├── asav-9-20-2
    │   ├── asav-9-20-2.yaml
    │   └── asav9-20-2-2.qcow2
    ├── cat8000v-17-13-01a
    │   ├── c8000v-universalk9_8G_serial.17.13.01a.qcow2
    │   └── cat8000v-17-13-01a.yaml
    ├── cat9000v-q200-17-12-01prd9
    │   ├── cat9000v-q200-17-12-01prd9.yaml
    │   └── cat9kv-prd-17.12.01prd9.qcow2
    ├── cat9000v-uadp-17-12-01prd9
    │   ├── cat9000v-uadp-17-12-01prd9.yaml
    │   └── cat9kv-prd-17.12.01prd9.qcow2
    ├── csr1000v-17-03-08a
    │   ├── csr1000v-17-03-08a.yaml
    │   └── csr1000v-universalk9.17.03.08a-serial.qcow2
    ├── iol-xe-17-12-01
    │   ├── iol-xe-17-12-01.yaml
    │   └── x86_64_crb_linux-adventerprisek9-ms
    ├── ioll2-xe-17-12-01
    │   ├── ioll2-xe-17-12-01.yaml
    │   └── x86_64_crb_linux_l2-adventerprisek9-ms
    ├── iosv-159-3-m8
    │   ├── iosv-159-3-m8.yaml
    │   └── vios-adventerprisek9-m.spa.159-3.m8.qcow2
    ├── iosvl2-2020
    │   ├── iosvl2-2020.yaml
    │   └── vios_l2-adventerprisek9-m.ssa.high_iron_20200929.qcow2
    ├── iosxrv9000-7-11-1
    │   ├── iosxrv9000-7-11-1.yaml
    │   └── xrv9k-fullk9-x-7.11.1.qcow2
    ├── nxosv9300-10-4-2-f
    │   ├── nexus9300v64.10.4.2.F.qcow2
    │   └── nxosv9300-10-4-2-f.yaml
    ├── server-tcl-14-0
    │   ├── server-tcl-14-0.yaml
    │   └── tcl-14-0.qcow2
    └── ubuntu-22-04-20240126
        ├── jammy-server-cloudimg-amd64.img
        └── ubuntu-22-04-20240126.yaml
20 directories, 51 files


Import refplat_xxx.iso to your hypervisor and import to VM.

Access - https://<YOUR_IP>:9090/virl2/maintenance

Click - Copy Refplat ISO

Processes for importing refplat
# lsblk /dev/sr0
NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0   11:0    1 12.8G  0 rom

# mount | grep sr
/dev/sr0 on /tmp/refplat_iso type iso9660 (ro,relatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8)

# ps auxf
\_ /bin/bash /usr/share/cockpit/virl2/copy-refplat-iso-to-disk.sh
    \_ /bin/bash /usr/share/cockpit/virl2/copy-refplat-iso-to-disk.sh
    |   \_ rsync -ahvzAX --partial --chown=libvirt-qemu:virl2 --chmod=g+w,Da+rx,Fa+r /tmp/refplat_iso/ /var/lib/libvirt/images
    |       \_ rsync -ahvzAX --partial --chown=libvirt-qemu:virl2 --chmod=g+w,Da+rx,Fa+r /tmp/refplat_iso/ /var/lib/libvirt/images
    |           \_ rsync -ahvzAX --partial --chown=libvirt-qemu:virl2 --chmod=g+w,Da+rx,Fa+r /tmp/refplat_iso/ /var/lib/libvirt/images
    \_ /bin/bash /usr/share/cockpit/virl2/copy-refplat-iso-to-disk.sh
        \_ sudo /usr/share/cockpit/virl2/manage-compute.sh --log-stdin setup/virl2-copy-refplat-iso-to-disk.log
            \_ /bin/bash /usr/share/cockpit/virl2/manage-compute.sh --log-stdin setup/virl2-copy-refplat-iso-to-disk.log
                \_ tee -a /var/log/virl2/setup/virl2-copy-refplat-iso-to-disk.log

Import Custom Images

https://github.com/CiscoDevNet/cml-community

https://github.com/ciscops/cml-custom-images

IP 변경

https://developer.cisco.com/docs/modeling-labs/editing-the-management-ip-address-via-the-console/

GitHub

https://github.com/CiscoDevNet/virl2-client

https://developer.cisco.com/docs/virl2-client/

https://github.com/CiscoDevNet/cml-community

https://github.com/WojciechowskiPiotr/CMLNetKit

Manual

https://developer.cisco.com/docs/modeling-labs/

https://learningnetwork.cisco.com/s/topic/0TO3i00000094ZjGAI/cisco-modeling-labs-personal-community