Skip to content

KVM Virtualized Router

Will edited this page Jun 2, 2019 · 9 revisions

Fedora Server 28

  1. Get everything up to date

  2. Install VIM (because that's how it goes)

  3. Add user to kvm and libvirt groups

  4. Ensure VM store is accessible to the libvirt group

    • chmod g+w /vm
  5. Add remote user SSH keys to authorized_keys

  6. Enable IOMMU

    • sudo grubby --args="intel_iommu=on" --update-kernel /boot/vmlinuz-4.16.6-302.fc28.x86_64
  7. Create VM

    1. Use OpenWRT 18.06.0

      1. qemu-img convert -f raw -O qcow2 openwrt-18.06.2-x86-64-combined-ext4.img openwrt-18.06.2-x86-64-combined-ext4.qcow2
    2. Configure network

    3. eth0 is attached to the bridge. Later, all other physical interfaces except WAN will be as well. Configure the bridge to use 10.0.0.1

    4. eth1 or whatever is "WAN" and set to use DHCP

    5. On the host:

      $ sudo virsh net-edit <network>

      <network ipv6='yes'>
      <name>vmnet</name>
      <uuid>56273237-b81e-4385-a559-4956722dbf9a</uuid>
      <bridge name='virbr0' stp='on' delay='0'/>
      <mac address='52:54:00:3f:57:6b'/>
      <domain name='vmnet'/>
      <ip address='10.0.0.2' netmask='255.255.255.0'>
      </ip>
      </network>

    6. On the host:

      $ sudo virsh net-destroy <network>
      $ sudo virsh net-start <network>

    7. You may need to restart the VM to make KVM happy.

Clone this wiki locally