Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am running KVM on RHEL6, and I have created several virtual machines in it. Issuing ifconfig command to the host system command line shows a list of virbr0, virbr1... and vnet0, vnet2... Are they the IP addresses of the the guest OS? What are the differences between virbr# and vnet#?

share|improve this question
add comment

1 Answer 1

Those are network interfaces, not IP addresses. A network interface can have packets from any protocol exchanged on them, including IPv4 or IPv6, in which case they can be given one or more IP addresses.

virbr are bridge interfaces. They are virtual in that there's no network interface card associated to them. Their role is to act like a real bridge or switch, that is switch packets (at layer 2) between the interfaces (real or other) that are attached to it just like a real ethernet switch would.

You can assign an IP address to that device, which basically gives the host an IP address on that subnet which the bridge connects to. It will then use the MAC address of one of the interfaces attached to the bridge.

The fact that their name starts with vir doesn't make them any different from any other bridge interface, it's just that those have been created by libvirt which reserves that name space for bridge interfaces

vnet interfaces are other types of virtual interfaces called tap interfaces. They are attached to a process (in this case KVM). What the process writes to that interface will appear as having been received on that interface by the host and what the host transmits on that interface is available for reading by that process. KVM typically uses it for its virtualized network interface in the guest.

Typically, a vnet will be added to a bridge interface which means plugging the VM into a switch.

share|improve this answer
    
Thank you so much for the answer! But, if virbr is a bridge interface, and as bridges are layer two devices, what does it need an IP address for(there are IP addresses following every virbr# interfaces)? –  xczzhh Oct 25 '12 at 8:33
    
I've updated the answer. The idea is to give the host an IP address on that network. –  Stéphane Chazelas Oct 25 '12 at 10:58
    
Thank you again for the reply. I know that two different guest OS created by KVM can share the same virbr, but what if I have a third guest OS which is connected to a different virbr, and these two virbrs are in different IP networks, what should I do so that these two networks can communicate with each other? –  xczzhh Oct 25 '12 at 11:46
    
the same thing you'd do with real switches. Some machine, typically the host since it's got an IP address on both networks would route between the two networks. It probably does so by default, but maybe you need to change the firewall configuration on the host. –  Stéphane Chazelas Oct 25 '12 at 11:58
    
Yeah, I've tried, but the problem is that OS A can ping OS B, but OS B cannot ping OS A. Do you know what might be the problem...? Thank you again :) –  xczzhh Oct 25 '12 at 12:41
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.