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.
I'm having problems with the network in Cent OS 6.0.
My Cent OS 6.0 host has IP 192.168.10.40. The gateway 192.168.10.1.
I want to create a Cent OS 6.0 guest with IP 192.168.10.41, so that all the clients on network 192.168.10.x can access this virtual server with ssh/telnet. Is this not possible ?
I can't get it to work. In Cent OS 5.7 it just worked out of the box. Because xen was with bridge network as default. Now in kvm its NAT. Så I just get a DHCP adress of something like 192.168.122.x.
So I have found out, that I must define a bridge network i kvm. But how ?
I've read the RH Virtualization doc and don't find the solution there and googlet alot.
Help will be apreciated.
Regards Thomas
Click here to see the post LQ members have rated as the most helpful post in this thread.
create /etc/sysconfig/network-scripts/ifcfg-br0 by copying it from /etc/sysconfig/network-scripts/ifcfg-eth0 then edit both files to match what you need, something like I have listed below
create /etc/sysconfig/network-scripts/ifcfg-br0 by copying it from /etc/sysconfig/network-scripts/ifcfg-eth0 then edit both files to match what you need, something like I have listed below
I'm new to KVM networking and have a few questions. The commands above just creates a bridge, correct? You would still need to create a virtual interface and add it to the bridge?
When you create the file for br0 as above and restart the network on the host machine then /dev/br0 becomes available as a bridged network interface It will effectively replace eth0 on the host machine as the network interface.
When you create a guest virtual machine you can select br0 as the interface for the guest system to connect through. (I have only done this with virt-manager - it will be available to select within the properties of the guest networking device). The network interface in the guest machine can be given an IP address which is in the same subnet as the host machine and it will function in the network as if it was a physical machine within the network.
ok, I answered my own question. For those of use not using virt-manager, you still need to create a virtual interface (tap0) and add it to the bridge (br0) using the bridge-utils and tunctl packages. I use a script to do this right before the VM starts.
Code:
#!/bin/sh
# qemu startup script
#
# This script first creates a virtual network interface (tap0) for the vm and adds it to the bridge (br0) before starting qemu.
#
/usr/sbin/tunctl -b
/sbin/ifconfig tap0 up
/usr/sbin/brctl addif br0 tap0
qemu-system-x86_64 -hda disk.img -boot d -m 1024 -net nic -net tap,ifname=tap0,script=no -no-acpi
Just need to make sure I understand. in the ifcfg-br0 you set an IP address. If I were to have 5 VMs all running at the same time connected to br0, they could all have different IPs addresses that everyone in the network could address?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.