Ok, my situation is as follows. I have:

-host (Ubuntu server 14.04) on which I want to have multiple VMs (KVM). This host has 2 NICs (eth0, eth1)

-home router (dhcp, network

-PC with virt-manager

I am stuck with network settings. What I want to have is, that each VM gets its own IP from router/DHCP and is also visible in home network (as normal physical computer). Lets say I "assign" eth0 for host and eth1 should be used by VMs.

Can someone who has experience please help me accomplish this, I am browsing web for 2 days and my head will explode of all this expressions and options...ip alias, bridge, virtual network switch, mac-vlan, macvtap, virtio, e1000. On ESXi you have vSwitch and thats it...

Update I found a solution. Expression "bridge" for what it does is/was a little misleading for me. I would call it switch, because it can join multiple networks together not just two (that does bridge). So I created a bridge (br0) with virt-manager (but can also be done with brctl command) and added eth0 to it. Qemu-kvm than automaticaly adds vnet adapters for each VM if its connected to bridge.

  • So, how did you make it too work? I would set up a bridge and configured that to use dhcp or static IP. Then I would add the eth0 to that bridge. The VM:s would then use the bridge to get to your lan. – Anders Nov 29 '14 at 4:27
  • 1
    Yes @Anders, thats exactly how i did it. It's easiest solution, although i read that macvtap is better in performance(less resource greedy), but thats not problem for me right now. – eleksis Nov 30 '14 at 20:48

You can set up a bridge to be automatically created on system startup by replacing the eth0 config in /etc/network/interfaces with this:

auto br0
iface br0 inet dhcp
    bridge_ports eth0
    bridge_fd 0
    bridge_stp off
    bridge_maxwait 5

Then you can set up your virtual machine to use the br0 bridge.

  • where is eth0 defined? – Thufir Nov 28 '17 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.