Linux - Virtualization and CloudThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.