LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   KVM Guest network unable to connect to Host in CentOS-6.3 (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/kvm-guest-network-unable-to-connect-to-host-in-centos-6-3-a-4175430385/)

mglaris 10-03-2012 08:40 PM

KVM Guest network unable to connect to Host in CentOS-6.3
 
Howdy,

I am attempting to create a VM using KVM under a CentosOS 6.2 host. I have worked on it for days and have tried dozens of potential solutions from various forums and web pages, but so far none have worked.

The basic setup is that I am running CentoOS 6.2 (kernel version 2.6.32-279.5.1.el6.x86_64) with virtualization enabled. I have created (and recreated) several Windows 7 and Cent-OS 6.3 clients, but none of the clients can access the host, let alone the Internet. The clients do not need to be visible from the Internet, but do need to be able to connect to the host. Internet access would be nice, but is not absolutly required.

The machine is a HP-Envy 17 3D laptop. I have an ethernet adapter (RealTek RTL8139C) that is not used, per se, and a wireles adapter that I use to connect to the internet. From the research I have sone thus far, it does not seem possible to use the wireless adapter in bridge. I am hoping that I can connect the VM's to eth0 and then setup a static route from eth0 to the wireless adapter.

At this point, I cannot even get from the Guest to the Host.

Running ifconfig yields the following:

eth0 Link encap:Ethernet HWaddr E4:11:5B:32:B4:29
UP BROADCAST PROMISC MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9808 errors:0 dropped:0 overruns:0 frame:0
TX packets:9808 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:40679561 (38.7 MiB) TX bytes:40679561 (38.7 MiB)

virbr0 Link encap:Ethernet HWaddr 52:54:00:42:67:59
inet addr:192.168.200.1 Bcast:192.168.200.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:4225 (4.1 KiB)

virbr1 Link encap:Ethernet HWaddr 52:54:00:81:55:44
inet addr:192.168.100.1 Bcast:192.168.100.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:4225 (4.1 KiB)

vnet0 Link encap:Ethernet HWaddr FE:54:00:BC:32:51
inet6 addr: fe80::fc54:ff:febc:3251/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:109 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:14196 (13.8 KiB) TX bytes:468 (468.0 b)

wlan0 Link encap:Ethernet HWaddr 24:77:03:51:83:B4
inet addr:192.168.1.4 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2677:3ff:fe51:83b4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10495 errors:0 dropped:0 overruns:0 frame:0
TX packets:4246 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4119294 (3.9 MiB) TX bytes:1144339 (1.0 MiB)



running brctl show yields:

bridge name bridge id STP enabled interfaces
br0 8000.e4115b32b429 no eth0
vnet0
virbr0 8000.525400426759 yes virbr0-nic
virbr1 8000.525400815544 yes virbr1-nic


At this point, I don't even know what questions to ask, and am hoping that someone who has more experience with VM and network setup can help me get this configured. I am a programmer by profession (30 years) and an Ok linux admin (as least the basic stuff) but this kind of configuration is outside or anything I've done before. Any and all help will be appreciated.

Mike Laris
mglaris@gmail.com

cultavix 10-04-2012 05:25 AM

How do you want the guest to connect to machines outside of the Host?

If you want your VM to act like another device on the network then use Bridged. To do this, you will need to create a bridged adapater which will be tied to the host adapater which is on the network you want to connect to.

mglaris 10-04-2012 07:47 AM

Allowing the guest to connect to machines outside of the host would be nice, but not absolutly required. I am taking a "one step at a time approach", so just getting the gest to be able to see the host, and the host see the guest would be huge.

That being said, I have tried to setup a bridge, but either did not do it right, or I have some other issue that is preventing it from working. I used the "brctl" command to create a bridge device, br0, that is connected to the eth0 physical device. When seting up the VM I can select NT or Routed, and can select the device. I have tried multiple options here, none of which have worked. I can respond with more details tonight when can run another test.

cultavix 10-04-2012 08:14 AM

In this rare case I actually recommend that you use the GUI tool that is built in to KVM.

So if you right click "localhost (QEMU)" and go to "details", then go over to network adapters, click the + symbol for a new adapter, then select Bridge, then add the adapter you want to bridge.... then just add it to your guest.

I used to do it manually myself but some reason having a problem with it on 6.3? It could just be me.

Good luck

mglaris 10-04-2012 07:13 PM

Well, that worked rather well. I was not able to get a bridge working, but I was able to get NAT working. I don't know why the bridge is not working, but I will attempt to setup a static route from eth0 to the wireless adapter. I have done that before, between normal (non-wireless) NIC's so I hope I can do it in this scenario as well.

Thank you very much for your help. I did not even know about the detail page for the guest until your post made me examine things a bit more closely. I'll post how things proceed from here.

cultavix 10-05-2012 05:01 AM

Good luck!! :)


All times are GMT -5. The time now is 06:45 AM.