In this post, It will be demonstrated how to create Bridges and VLANs to be used on KVM. In my other post, I already implemented VLANs using Openvswitch.
Physical host that I used on this lab is Linux Mint 20 (Ulyana).
Netplan is a utility for easily configuring networking on a GNU/Linux systems. You can easily create network configuration with YAML syntax. Netplan reads network configuration from /etc/netplan/*.yaml
which are written by administrators, installers, cloud image instantiations, or other OS deployments.
Prerequisite:
Before starting any configuration you have to load the module 8021q, if it is not loaded. For Linux Mint 20 it is loaded automatically on boot.
Creating a netplan configuration File:
Create a file in the /etc/netplan/bridge.yaml and copy the content below. Of course you can change the configuration based on your needs.
|
|
After netplan config created , syntax check should be made before apply the configuration.
|
|
|
|
Once the configuration applied, bridges and vlan interfaces should be created. You can check it with the utility brctl.
|
|
You can simply see the Figure below to understand easily how our physical host looks like now. In this post, you can ignore the Physical switch and Router part, as we did not do any Physical switch and Router configuration for Intervlan routing.
Once netplan configuration has been completed, you can check on virt-manager if you are able to see the bridges(VLANs)
Experiment
On the VM, I just ping the IP that does not allocated by any machine to create a Broadcast package to sniff via Wireshark.
I pinged to 10.5.100.23 from 10.5.100.10(VM) .
As you see in the figure above, You can see the frame 802.1q section. Which means vlan configured successfully.