When installing a KVM VM in Ubuntu, one of the question is: How to configure its network.
There is basically two choices:
This bridge will act as a DHCP server + a gateway. VMs will be able to reach internet but their source IP address will be seen as the virbr0 IP.
Libvirt allows to do that, assuming you have
The steps:
There is basically two choices:
- A virtual bridge that will NAT the VMs connected to it.
- A physical bridge so that all VMs will be able to have a "public" IP address
NATing virtual bridge (default, virbr0)
This is the default bridge if you follow the Ubuntu Official tutorial.This bridge will act as a DHCP server + a gateway. VMs will be able to reach internet but their source IP address will be seen as the virbr0 IP.
Non-NATing bridge
Most of my time, I want to use VMs as public servers. Having them NATed as described above is quite uselss for that purpose.Libvirt allows to do that, assuming you have
The steps:
- Create a bridge containing only the physical existing interface
- Each created VM will then join that bridge