Link to home
Create AccountLog in
Avatar of barrykfl
barrykflFlag for Hong Kong

asked on

Confuse on KVM , Host and Guest Network VS VMWare

Hi:

I m very confuse on using KVM vs VMWARE..i use vnware before if i brige the vnet card both host and guest OS can access internet browser but in KVM if i bridge eithe one mostly the guest can access it ...it seem swapping rather then share like vmwamre.

Actually what is the setting that allow eth0 in host to share all host and guest VM to run browser freely?

My pc only 1 network host port and installed KVM and different linux hosting.
Avatar of rindi
rindi
Flag of Switzerland image

Maybe I'm misunderstanding your issue, but I've installed KVM on my OpenSUSE host, and my VM guests all use "Host Device eth0 (bridge 'br0')" for the NIC, and I can access the internet using the host OS and the from the VM's at the same time. Also, as is normal when using bridge mode the virtual NIC within the VM looks just like an additional NIC on the same LAN as the host. It works exactly the same as when using other hypervisors, like those of VMware or Oracle's VirtualBox. I don't see any difference, and it is working as it is supposed to in KVM.
I'm running SuSE 12.2 with KVM, and have some other CentOS 6 systems also running KVM.

Essentially, I have br0 as a bridge on eth0, and both the local computer and the KVM guests all access the network as if it were their own network card. They are configured to use 'Host device vnet0 (Bridge 'br0')

I generally do the network configuration through the Virtual Machine Manager - if you select the localhost (QEMU), right click 'Details' you can create the bridge from there and it generally gets configured the way KVM needs it.
Avatar of barrykfl

ASKER

Is there any confflict between host and guest naming eth0 as same linux...???

i set host eth0 name "eth0" now the guest eth0 is "System eth0" seem both work now,

Before i reallly set the guest brige eth0(briged0) ...the guest OS work to internet
but then the hostfail.

dont know why it comes work again !!!

still under montoring
SOLUTION
Avatar of Beneford
Beneford
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
For the Guest the virtual NIC the host presents the VM with just looks like a standard NIC, so there you would normally use eth0, eth1, eth2 etc. It's just as if you'd install the guest on it's own hardware with it's own NIC.
I figure out that when it not work ... both br0  and physical eth0 will show same ip ..
but if i stop the br0 invm interface and start again ....the eth0 ip will disappeared seem work again.


br0   Link encap:Ethernet  HWaddr 00:13:72:0B:14:57
          inet addr:192.168.2.17  Bcast:255.255.255.255  Mask:255.255.255.0
          inet6 addr: fe80::213:72ff:fe0b:1457/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2282 errors:0 dropped:0 overruns:0 frame:0
          TX packets:908 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1394144 (1.3 MiB)  TX bytes:98902 (96.5 KiB)

eth0      Link encap:Ethernet  HWaddr 00:13:72:0B:14:57
         inet addr:192.168.2.17  Bcast:255.255.255.255  Mask:255.255.255.0
          inet6 addr: fe80::213:72ff:fe0b:1457/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6151 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3203 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:6407427 (6.1 MiB)  TX bytes:341028 (333.0 KiB)
          Memory:fe3e0000-fe400000

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:1656 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1656 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3606505 (3.4 MiB)  TX bytes:3606505 (3.4 MiB)

virbr0    Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:8275 (8.0 KiB)
HI all:

it failagain ...host cnnot go google but guest can, any setting wrong i set ????
Screenshot.jpg
In your screenshot you have an additional interface, vnet0. Maybe your VM is trying to use that for it's interface instead of the eth0 one which it should use.
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
i can ping the gateway only the firefox of host not work.

Virtual Networks  < default virbro...

Yes ...it can work for a while BUT : ( i tried both using manual or interface add same, spend whole day)

br0 - ip address
eth0 - no ip address  < this work for a while sometimes

But when i reboot it will become

br0 - ip address
eth0 - ip address

It seem the bridge can either br0 or eth0 standalone ...otwerise one interface will fail...i spend too mcuh time to fix it ,,so may be add  one more phusycial eth1
Rely  Rindi:

vnet0 will run and appear when your guest host turn on and disappear if it off.

SO normal bridge should be eth0(br0) something like that. it should include both  if the guest is on. ...

Is it CentoS 6 issue? the default NAT work well but i want my guest bridge to outside world.
maybe cosndier to add 2nd network card eth1
Any more idea ? ...seem if practical case it is beter to form 2nd inteface to bridege not affect the host eth0
Show us the network configuration of the VM, not the host. If the VM uses eth0 there should be no issues.
Can you check /etc/sysconfig/network

You should have ifcfg-br0 - with fixed ip or dhcp set - most likely this is already correct
You should not have ifcfg-eth0 - delete (or move to another directory) it if it is there.

My network configuration for SuSE 12.2 was automatic after installation, so if you have the opportunity you could try reinstalling the OS and using YaST to install all the bits you need.