LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 07-02-2018, 05:01 PM   #1
mwerne01
LQ Newbie
 
Registered: Jul 2018
Posts: 1

Rep: Reputation: Disabled
KVM Virt-Manager and virtual networks question


Trying to set up a VM on CentOS 7 KVM using virt-manager. With this VM I want to be able to assign a static IP address to it. Can't seem to get it to work on the network. On the KVM host I configured interface eno1 to use bridge virbr2 and assigned the IP address to virbr2. Works fine. For VM network traffic I configured interface eno2 on the KVM host to use bridge, virbr3. No IP address is assigned to virbr3. In virt-manager I configure a virtual network. Seems you have to define an IP Range, which I don;t understand why, if I just want to assign an IP address to the VM. And you cannot use the same IP range that your KVM management is using on eno1 because it is already in use. So apparently you cannot have VMs on the same subnet as KVM management. so fine. I give it another IP range. I choose to connect to the physical device virbr3 and to use Routed mode (no clue what Open mode is. Cannot find any info anywhere about it). Once that is done I configure ifcfg.eth0 on the VM with IP address in the IP range I defined for my virtual network. Switch port for eno2 is configured simply as access port on the VLAN for which the IP range is a part of. No network connectivity. Restarted network service. Rebooted. Nothing. Makes no sense. Also, when creating the virtual network in virt-manager, it defines the device for that virtual network as virbr0. What is that? Where is that? I don't see it on the VM. I don't see it on the KVM host. I see it defined in the XML file for the virtual network as Bridge, but where is that? The XML file also shows forward dev as virbr3. Is virbr0 supposed to be created somewhere because that is the device assigned to the virtual network, or is that created on the ovs? And if it is supposed to be created what info should be in it? Any help is appreciated. Spent way too much time trying to figure this out. Thank you.
 
Old 07-04-2018, 03:27 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
If you want a VM to have a static IP address, you must configure the virtual NIC inside the VM to have the desired address. You can not manipulate the IP address configuration of the VM by messing around with the hypervisor's virtual networks.

A virtual network is just that, a virtual network. The hypervisor can create such networks and act as a virtual switch between VMs (the virbr interfaces you mentioned) or even be present as a host or router inside those networks (a virbr interface with an IP address).

If you want the VM to have a static IP address inside a virtual network, you obviously have to create that virtual network. If you just want the VM to have a static IP address in the same network as the host hypervisor, bridge the VM NIC to the main NIC of the hypervisor (you may have to create that bridge first).

In the future, try using paragraphs. The most likely reaction for most people to a Massive Block of Text like the one above is TL;DR.
 
2 members found this post helpful.
Old 07-04-2018, 03:27 AM   #3
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Hi,

To me, you seem to have several assumptions about the way KVM works that are not accurate, thence the confusions and so many questions.

By default, I assume you tried to use the KVM defaults, KVM does snot allow the VMs to connect to the external network the host is connected to.
The KVM networking (DNHXP and DNS) for VMs and the host is managed by a dnsmasq instance that is started on the fly from KVM default network.
There no "configuration file", so you need to modify the XML structure of the default network in order to modify it further than the graphical interface allows.

I recommend you to go to the official KVM website and read the networking related pages to get familiar with how KVM manages networking.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is kvm with virt-manager better to use over virtualbox and vmware gEEk_X99 Linux - Virtualization and Cloud 22 03-26-2015 08:00 PM
How to bridge with KVM / Qemu / Virt-manager? Red Squirrel Linux - Virtualization and Cloud 6 12-27-2014 07:44 AM
[SOLVED] virt-manager VS qemu - which one uses KVM? ramzi.kahil Linux - Kernel 1 04-11-2014 12:39 PM
virtualization - latest virt-manager/kvm Nick_C Linux - Server 3 03-09-2012 07:40 AM
KVM + qemu + virt-manager issues cyanide_will Linux - Software 4 04-15-2008 01:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 09:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration