Have gotten a server from SoYouStart (cheap OVH) that was planning on setting up a few KVM guests.
Installed Debian Jessie and the required packages qemu-kvm
libvirt-bin
virtinst
.
Acquired additional IPs from SYS, now the fun part.
Using Xen terminology the IPs are:
- DomU: 94.xx.xx.20
- Dom0: 145.xx.xx.35
- Dom1: 188.xx.xx.47
SYS suggests the additional IPs are configured as IP Aliases (and in their control panel wants virtual Mac addresses assigned to these).
Original /etc/network/interfaces
auto eth0
iface eth0 inet static
address 94.xx.xx.20
netmask 255.255.255.0
broadcast 94.xx.xx.255
gateway 94.xx.xx.254
Adding the entry to /etc/network/interfaces
auto eth0:0
iface eth0:0 inet static
address 145.xx.xx.35
netmask 255.255.255.255
post-up /sbin/ifconfig eth0:0 145.xx.xx.35 netmask 255.255.255.255 broadcast 145.xx.xx.35
pre-down /sbin/ifconfig eth0:0 down
assigns this as expected. (If no MAC configured in SYS panel this is pingable, otherwise it is not).
Using the suggested iproute2:
ip link add name br0 type bridge
ip link set br0 up
ip link set eth0 up
ip link set eth0 master br0
prevents access to the host (DomU) as does attempting to use eth0:0
How do I keep 94.xx.xx.20
accessible for administering the host whist also making 145.xx.xx.35
and 188.xx.xx.47
accessible from the outside world to a KVM guest for services like apache?
I will be installing the KVM guest via virt-install
specifying the MAC assigned via the control panel using the --mac
argument.
Best Answer
Assign the bridge your IP address, not eth0:
/etc/network/interfaces:
In the guest VM's XML definition something like this should work (I'm not familiar with OVH, this works on KVM/QEMU/libvirt machines and populates the MAC address):
More gory details, debian-specific, are available at the Libvirt Wiki