KVM - multiple VLANS down one interface

Issues related to hardware problems
Post Reply
robertw
Posts: 189
Joined: 2012/04/25 13:26:59

KVM - multiple VLANS down one interface

Post by robertw » 2017/06/16 13:20:10

hi all,

i have successfully configured putting multiple VLANS down one interface so you can make different kvm guests connect to different VLANS

the trick was to add a bridge for every VLAN otherwise it wont work

DEVICE=enp2s0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes

DEVICE=enp2s0.1
BOOTPROTO=none
ONBOOT=yes
VLAN=yes
BRIDGE=br0.1

DEVICE=enp2s0.2
BOOTPROTO=none
ONBOOT=yes
VLAN=yes
BRIDGE=br0.2

DEVICE=br0.1
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=none
DELAY=0

DEVICE=br0.2
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=none
DELAY=0

and now when you come into making a kvm guest pick either br0.1 or br0.2 ie if you want the kvm guest to either be on vlan 1 or vlan 2, once that is done give it an ip address for that vlan and boom, you can now ping it from a different machine

sorry for multiple threads about this

many thanks for everyones help

rob

Post Reply