KVM - multiple VLANS down one interface
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 |
Quote:
Hi Rob thanks for the explanation, I got this except the IP part I have server the following: *Server Host ens1 , ens2 with VLAN 10 IP 10.0.0.2 Taking in consideration the bonding part on these physical ports *1 VM with : NIC 0 VLAN 20 IP x.x.x.1/28 *1 VM with : NIC 0 VLAN 20 IP x.x.x.2/28 - NIC1 VLAN 30 IP x.x.x.3/28 where these IP's should reside ? can you please advice ? thanks |
I didnt make an IP address for this NIC interface as its a bridge so all it does is literally just pass vlan traffic down it
You specify an IP address on the virtual machines you build on your hypervisor and if all goes as planned you can ping your virtual machines ip from another machine on the same network or a different network To manage my KVM i use a different NIC and that has an IP address Hope this makes sense |
So you mean it is independent from Host ?
as I got confused since I believe I will have to deal with 3 VLANs and 2 Physical links bond0.10 .. br10 HOST bond0.20 .. br20 for VM1 , bond0.30 .. br30 - br20 for VM2 will use 2 VLAN 20 and 30 ? I dont know if this is possible Do I need to setup the gateway IP on the host on Br3 or all Bridge to be gateway to other VMs ? So VM1 will use 20 1 NIC IP x.x.x.x VM2 will use 20, 30 2 NICs IP x.x.x.x and IP x.x.x.x Thanks |
Similar Clarification needed for IP address palcement
I too have the same question:
Host Part: My Physical host box with Cent OS 7.6 has two NICs (em1 and em2) which was trunk port on DELL Switch. The NICs are bonded with bond0. The VLAN for host machine is vlan-302 (192.168.2.12/24). KVM part: Two VMs has been configured inside this host. Each VM is having different VLAN than that of the host.
With the above scenario, I am able to finish up to the bonding part and successfully communicating with the outside networks from the host. But I am unable to communicate from VMs and messing things up with interface files. Can someone kindly provide me the configuration files along with above IP address for a better understanding. I tried many sites and found no detailed explanation for my case. Thanks in Advance |
All times are GMT -5. The time now is 06:19 AM. |