Article 548TJ KVM networking with VLANs

KVM networking with VLANs

by
warrenn
from LinuxQuestions.org on (#548TJ)
Hello,

I'm a little ashamed to say that I am still running Debian 9 on my main KVM host server.

I have (what seems to me but probably not) a slightly complicated set up that I'm a little concerned about breaking during the upgrade. In any case, I'd really prefer to install fresh and then copy any VM data back but my main concern is downtime.

The host is running Debian 9 with stretch backports QEMU-KVM, which is plugged into a trunked port on a managed switch.

My goal would be:

Host connected to switch.
All IPs to be DHCP (static IPs to be issued via the router).
Host on VLAN 10, DHCP
VM20 on VLAN 20, DHCP
VM30 on VLAN 30, DHCP
etc..

In my existing set up (a long time ago), I did the following:

1. Set up networking as:

Code:$ sudo nano /etc/network/interfaces
# 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
allow-hotplug eno1
iface eno1 inet manual2. Created virtual interfaces and virtual bridges as:

Code:# The vlan 10 network interface
auto eno1.10
#allow-hotplug eno1.10
# seemed to break networking (at boot) so commented out
iface eno1.10 inet manual
vlan_raw_device eno1

# The vlan 10 bridge
auto virbr10
#allow-hotplug virbr10
# seemed to break networking so commented out
iface virbr22 inet dhcp
bridge_ports eno1.10
bridge_stp off
bridge_fd 0
bridge_maxwait 0

### Repeat as required..3. Assigned the relevant bridge to the guest VM as required, and assign IPs via router.

I'm a little out of touch and much of the documentation online still references eth0, which worries me that it's also outdated and will lead to errors.

Is this still best practice? Does the config file look OK? Any tips, additions or errors?

Thanks,latest?d=yIl2AUoC8zA latest?i=Dv575e9scns:spd_uv1mk44:F7zBnMy latest?i=Dv575e9scns:spd_uv1mk44:V_sGLiP latest?d=qj6IDK7rITs latest?i=Dv575e9scns:spd_uv1mk44:gIN9vFwDv575e9scns
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments