I set up my first ubuntu server recently and I am struggeling with netplan.
As I need a Windows to run one service which isnt available on linux, I try to set up KVM.
The server has serveral static ips used for different services or docker containers running services, so my netplan config looks like this:
network:
version: 2
renderer: networkd
ethernets:
enp30s0:
dhcp4: no
addresses: [xxx.xxx.xxx.100/24, xxx.xxx.xxx.102/24, xxx.xxx.xxx.105/24, ...]
gateway4: xxx.xxx.xxx.1
nameservers:
addresses: [xxx.xxx.xxx.1]
Now it seems as I need to create a network bridge to make it available for the guest machine, but I was unable to find a solution to do so only for 1 adress.
Is there any way to achieve this, or am I making a conceptual mistake here?
Any help would be highly appreciated! Thank you.
Exampels on netplan.io like Bridging with Libvirt should be the way to go. You'd set up a bridge in the Host linked with the external interface - in your case enp30s0. Then tell libvirt to use that bridge and your guest will get devices on this.
You then will either need to setup libvirt/dnsmasq in the host to serve IPs to the guests from the range that you want to, or configure your guests statically in the guest to the addresses you want them to use.
Something like
And in the guest
And for libvirt network to use the bridge as provided by the system:
A lot of the details depend on your needs, but that should outline the path to go. I'm sure people will appreciate when you got it running if you could update your post with the final effective config that got you working.
Ubuntu 18.04 settings still depend on Network Manager, and wifi/3G is not supported by networkd yet. The following example uses Network Manager for all interfaces.
/etc/netplan/01-netcfg.yaml
Steps to add a bridge to libvirt.
Create a file /tmp/br0.xml
Now have libvirt add the new network, and autostart it.
The br0.xml file will be in /etc/libvirt/qemu/networks. The default NAT network file will be here as well. Check that br0 has been added successfully.
All new network interface additions will have a br0 bridge option.