Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expose VMs to the Network via Public Bridge

Ubuntu Server

Strange... somehow KVM can setup up a Public Bridge during boot of the VM and this can be manipulate manipulated using VMM (Virtual Machine Manager).

First confirm the name of your active network card.

(to put instructions here)

Using VMM. Turn off you VM if not already off. Load Information window. , choose NIC. Change , change Network source to Host device macvtap. Notice KVM auto generated a unique mac.

Boot and now your VM exists like a real machine on your existing network....

But this is not really a good solution and problematic as I found with Ubuntu Desktop... leading to the real solution which is to use VMM at the higher level and configure a proper bridge.

Finally found the clarity by following instructions at techotopia.com through VMM (not you . Note as you follow the VMM GUI instructions you will find VMM will get disconnected after it executes though and the client hands). It was not clear anywhere, but what you do is,changes. Just reconnect after the changes are done.

Abridged notes...

  • Determine your existing network interface that works, in my case enp2s0.
  • Make a new bridge interface we'll call br0
  • Make enp2s0 slave to br0
  • br0 then is your new primary interface, receiving the host's IP address on your NIC
  • But it also is in bridge mode so VMs choosing to use br0 will get their own IP address against the same network via dhcp

...

... put original file here...

To static config,this

... to pu here ...

Additionally if you want to use a static IP,

Go from this,

Code Block
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp2s0
iface enp2s0 inet static
address 192.168.0.7
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1

To And after using VMM resulting in to configure the bridge it should look like this,

Code Block
languagebash
 This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto br1br0
iface br1br0 inet dhcp
   bridge_ports enp2s0
   bridge_stp on
   bridge_fd 0.0

And this to give br1 then you need to manually edit to give br0 the static ip,

Code Block
languagebash
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto br0
iface br0 inet static
   address 192.168.0.7
   netmask 255.255.255.0
   gateway 192.168.0.1
   dns-nameservers 192.168.0.1
   bridge_ports enp2s0
   bridge_stp on
   bridge_fd 0.0

...


Ubuntu Desktop

Did not work retrofitting... so this time trying during vm setup before install,

...