Running your own lab: CML and Linux notes
NTpath's live labs and NTprompt run in the browser with nothing to install. When you want real IOS images, Cisco Modeling Labs (CML) is the licensed way. These notes fix the problems that took the longest the first time.
When CML cannot reach the internet
Symptom: the licence will not register, system updates fail and the server cannot ping a name, though it pings 8.8.8.8. The server has no working DNS resolver. The CML server is Ubuntu-based and resolves names through systemd-resolved.
sudo nano /etc/systemd/resolved.conf
[Resolve]
DNS=8.8.8.8 1.1.1.1
FallbackDNS=8.8.4.4 1.0.0.1
sudo systemctl restart systemd-resolved
resolvectl statusUse your own network's DNS server if it has one. After the change, the licence registers and updates download.
Give lab routers the internet
CML's external connector joins a lab to the outside. In NAT mode it puts the lab behind the server's own address (on the virbr0 bridge, 192.168.255.0/24 by default); in bridge mode the lab sits on your home network. NAT mode is the safer start.
interface GigabitEthernet0/0
description to the external connector
ip address dhcp
ip nat outside
interface GigabitEthernet0/1
ip address 10.1.1.1 255.255.255.0
ip nat inside
!
access-list 1 permit 10.1.1.0 0.0.0.255
ip nat inside source list 1 interface GigabitEthernet0/0 overload
ip name-server 8.8.8.8If the router reaches the server but not beyond, check forwarding and NAT on the server itself:
sudo iptables -t nat -L -n -v
sudo iptables -A FORWARD -i virbr0 -o ens160 -j ACCEPT
sudo iptables -A FORWARD -i ens160 -o virbr0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -t nat -A POSTROUTING -s 192.168.255.0/24 -o ens160 -j MASQUERADE- Test from the router with
ping 8.8.8.8, then a name. If addresses work and names do not, it is DNS again. debug ip naton the router shows each translation;traceroute 8.8.8.8shows where the path stops.- If you joined virbr0 to the uplink by mistake and the server lost its address, undo it with
sudo ip link set ens160 nomaster, thensudo dhclient ens160.
Use your own terminal
CML's breakout tool runs on your computer and gives every console a local telnet port, so PuTTY, MobaXterm or the macOS Terminal open them instead of the browser. On Windows, register your terminal as the handler for telnet:// links so a click in CML opens it.
Linux commands that keep coming up
| Task | Command |
|---|---|
| Rename the host | sudo hostnamectl set-hostname lab-server |
| Addresses | ip addr show (the old ifconfig may not be installed) |
| Add an address | sudo ip addr add 192.168.1.100/24 dev eth0 |
| Default route | sudo ip route add default via 192.168.1.1 |
| Ask DHCP again | sudo dhclient eth0 |
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1Then sudo /etc/init.d/networking restart (Alpine) or a reboot. Changes made with ip alone are lost at the next boot.
| vi | Does |
|---|---|
i | Start typing (insert mode) |
| Esc | Back to command mode |
:wq then Enter | Save and quit |
:q! then Enter | Quit without saving |
h j k l | Move left, down, up, right |
Images and licences
Use only images you are licensed for: CML includes its reference platforms, and Cisco's SD-WAN lab tool (the catalyst-sdwan-lab package) deploys SD-WAN into CML with images you download from Cisco. "Full packs" of Cisco images and IOU licence generators shared online are not licensed, and they are a common way to get malware.