31 กรกฎาคม 2567

Mikrotik CHR on debian with qemu-kvm

sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virtinst libvirt-daemon
sudo apt install cpu-checker vim unzip

sudo vi /etc/network/interfaces

iface enp1s0 inet manual

auto vmbr0
iface vmbr0 inet dhcp
        bridge-ports enp1s0
        bridge-stp off
        bridge-fd 0
        bridge_maxwait 0

auto vmbr1
iface vmbr1 inet static
        address 10.0.0.20/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0
        bridge_maxwait 0
  
sudo systemctl restart networking

wget https://download.mikrotik.com/routeros/7.15.3/chr-7.15.3.img.zip
unzip chr-7.15.3.img.zip

sudo mv chr-7.15.3.img /var/lib/libvirt/images/

sudo virt-install \
--name mikrotik \
--ram 512 \
--disk path=/var/lib/libvirt/images/chr-7.15.3.img,format=raw \
--vcpus 1 \
--os-variant debian10 \
--network bridge=vmbr0 \
--network bridge=vmbr1 \
--graphics none \
--console pty,target_type=serial \
--import

sudo virsh autostart mikrotik

sudo virsh console mikrotik
sudo virsh reset mikrotik
sudo virsh reboot mikrotik
sudo virsh start mikrotik
sudo virsh shutdown mikrotik
 

ref : https://reintech.io/blog/installing-using-kvm-virtualization-debian-12