0

I am new to KVM and am having a problem with setting up the networking. I want each VM to get its IPs assigned by the network's DHCP, not the internal DHCP that the KVM keeps trying to set up. In Hyper-V, you can create a virtual switch, then create a virtual interface for each VM that is then visible to the rest of the network, gets its IP from network DHCP, etc. I thought I could do this with Open VSwitch, but everything I set up either requires me to specify a static IP or sets up NAT and an internal (to the KVM) DHCP server, or kills my network connection entirely, requiring me to connect to the terminal directly. Can anyone point me in the right direction? I can't seem to find any documentation that describes how to do what I am looking to do.

I'm running this on Debian 11, command line only.

1 Answers1

0

You need to set up a bridge interface in your network configuration, where the member is the host's networking interface.

Then you need to use the bridge interface in the VM configuration as the interface. For example, in virsh XML configuration, the definition looks like this:

    <interface type='bridge'>
      <mac address='52:54:00:1c:00:3a'/>
      <source bridge='br0'/>
      <model type='e1000e'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58