IOL L2/L3 vrnetlab Build — Fix Summary
====== IOL vrnetlab Container Fix Summary ======
===== Root Causes =====
Missing ''python3'' in Docker image — license generation silently failed
No ''.iourc'' license file — IOL boots but drops all traffic without it
License must match the container hostname, not the host machine hostname
Wrong netlab device type — ''iol'' generates L3 management config incompatible with L2 image
Old 32-bit binary (2014) — use 64-bit binary from CML refplat
===== 1. Get the correct binary =====
From CML refplat ISO, rename accordingly:
L2
cp x86_64_crb_linux_l2-adventerprisek9-ms cisco_iol-L2-17.12.01.bin
L3
cp x86_64_crb_linux-adventerprisek9-ms cisco_iol-17.12.01.bin
===== 2. Dockerfile changes =====
Add ''python3'' to the apt install block:
RUN apt-get update &&
apt-get install -y --no-install-recommends
iproute2
iputils-ping
net-tools
sudo
curl
ca-certificates
gnupg
python3
&& apt-get clean
===== 3. Replace entrypoint.sh =====
Generate ''.iourc'' dynamically at container startup based on container hostname:
#!/bin/bash
echo "Launching IOL with PID" $IOL_PID
Generate iourc license based on container hostname
python3 -c "
import hashlib, socket
hostname = socket.gethostname()
iou_id = int('$IOL_PID')
seed = '{:04x}'.format(iou_id) + hostname
md5 = hashlib.md5(seed.encode()).hexdigest()[:8]
print('[license]')
print(hostname + ' = ' + md5 + ';')
" > /iol/.iourc
cp /iol/.iourc /root/.iourc
echo "Generated iourc for $(hostname)"
Clear ip addressing on eth0 (it 'belongs' to IOL now)
ip addr flush dev eth0
ip -6 addr flush dev eth0
echo "Flushed eth0 addresses"
sleep 5
exec /usr/bin/iouyap 513 -q &
max_eth=$(ls /sys/class/net | grep eth | grep -o -E '[0-9]+' | sort -n | tail -1)
num_slots=$(( (max_eth + 4) / 4 ))
exec /iol/iol.bin $IOL_PID -e $num_slots -s 0 -c config.txt -n 1024
===== 4. Build the image =====
Use the ''srl-labs'' vrnetlab fork:
cp cisco_iol-L2-17.12.01.bin
/home/jaime/netsim-labs/mydownloads/srl-vrnetlab-fresh/cisco/iol/
cd /home/jaime/netsim-labs/mydownloads/srl-vrnetlab-fresh/cisco/iol
make
===== 5. topology.yml =====
Use the correct netlab device type:
L2 switch
provider: clab
defaults.device: ioll2
defaults.devices.ioll2.clab.image: vrnetlab/cisco_iol:L2-17.12.01
nodes:
s1:
s2:
cl:
links: [ s1-s2, s1-cl, s2-cl ]
L3 router
provider: clab
defaults.device: iol
defaults.devices.iol.clab.image: vrnetlab/cisco_iol:17.12.01
===== Key Lessons =====
^ Issue ^ Symptom ^ Fix ^
| Wrong device type | ''vrf forwarding'' invalid input errors | Use ''ioll2'' for L2, ''iol'' for L3 |
| Missing license | IOL boots, SSH up, but zero traffic forwarded | Generate ''.iourc'' dynamically in entrypoint |
| Wrong hostname for license | License generated but still no traffic | Use container hostname, not host machine hostname |
| No python3 in image | License generation silently fails | Add ''python3'' to Dockerfile |
| Old 32-bit binary | Missing 32-bit libs needed | Use 64-bit binary from CML refplat 17.x |