Understunding TAP a bridging

Discussions related to using VirtualBox on Linux hosts.
Post Reply
sirio81
Posts: 10
Joined: 5. Sep 2008, 14:31

Understunding TAP a bridging

Post by sirio81 »

Hi all, this is my first experience with vbox and virtualization in general.
I virtualized a distribution called debian-edu (guest) insede a debian lenny (host).

I test the "internal network" with another guest and it works fine.

Now I'm studing HIF (host interface networking).
When a guest is using such a new software interface, it looks to the host system as though the guest were physically connected to the interface using a network cable:
Since the Linux kernel has built-in support for virtual network devices (so-called TAP interfaces), VirtualBox on Linux makes use of these
From the point of view of the host, it looks like the guest’s network card is connected to the TAP interface with a network cable.
So, from that I understund that , even before create the bridge, the guest and the host are i contcatc bye the virtual network card vbox0.

Code: Select all

host-eth0 (phisical)
       -vbox0 (virtual)
            |
            |
guest-eth0
In theory, i should be capable of pinging the host from the guest because the ICMP request goes from guest eth0 to vbox0 on the host.
Is it right?

I created the vbox interface (VBoxAddIf vbox0 myuser) and checked that myuser is in the vboxusers group.
I enabled only a netowrk card in the virtual machine (guest) choosing "host interface" and setting "vbox0" like "interface name".
When I start the virtual machine, the guest doesn't show any interface (ifconfig). Why is it not correct? What should I do?


Actualy I'm not trying to create a bridge. I'm just trying to understund the theory and functions of vbox (and networking in general).

If what I say is right, any request (tcp packages) from guest interface, arrive to vbox0 and stop there (without the bridge).
Setting up the bridge between the host interfaces (eth0 and vbox0) will forward the rquest from the guest (from its eth0) to exit from the host eth0, reaching the true network.
Is it right?

Code: Select all

                         
computer1---------
                  switch
computer2---------
                   |
                   |
host-eth0 (phisical)--
       -vbox0 (virtual)
            |
            |
guest-eth0
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

You are spot on on your assumptions. This is exactly how HIF works. As for your eth0 issue, did you change the MAC address by chance that is send to the VM? If you did, then you need to modify your rules file to reflect this. Default location for it (on my Ubuntu) is /etc/udev/rules.d/70-persistent-net.rules. Either remove the lines or edit it, then reboot the Guest system.
Last edited by Sasquatch on 6. Sep 2008, 00:34, edited 1 time in total.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
jschellhaass
Posts: 4
Joined: 5. Sep 2008, 23:04

Post by jschellhaass »

What does ifconfig -a show on the guest?

jeff
sirio81
Posts: 10
Joined: 5. Sep 2008, 14:31

Post by sirio81 »

As for your eth0 issue, did you change the MAC address by chance that is send to the VM?
What do you mean? Why should I chagne the MAC address? Are you speaking about the guest eth0?
Actualy, what I want is to have an eth0 on the guest that comunicates with vbox0 with the host.

From the "ifconfig" of the guest, I see only the loopback, no eth0.
On the vritual machine settings I enabled only a network card (HIF).


On the host (didn't configure yet)

Code: Select all

vbox0     Link encap:Ethernet  HWaddr 00:ff:31:37:63:fd
          inet6 addr: fe80::2ff:31ff:fe37:63fd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:16 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
Should I see an eth0 or not adding an HIF in the virtual machine?

The geust distribution run a dhcp itself, can it be a problem?

Thanks
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

You did add the vbox0 interface to the config of your Guest system where it supposed to be? If you create a HIF and attach it to your VM, you get what you want, a 'tunnel' from Guest eth0 (or 1,2 or 3, depending on which interface you set it ;)) to the Host vbox0 (or other name you specify).

You did read the manual about Host Interface Networking, right? A bridge as desribed there is only needed if you want to go outside of your Host.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
sirio81
Posts: 10
Joined: 5. Sep 2008, 14:31

Post by sirio81 »

You did add the vbox0 interface to the config of your Guest system where it supposed to be?
Yes. Actualy I set it on "interface 2" (o and 1 are disabled and I use them for internal network).
In the field "interface name" I wrote "vbox0".
In the fiels "install application" and "end apllication" I didn't insert anything because I do not know what they are used for.
Anyway, on the guest, with these settigns, I have only the loopback :(
I'm using vbox 1.6.6 OSE.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

Check lshw -C network, there you see if the VM actually sees the NIC and what name and driver it uses. If no driver is set for it, it will show as "DISABLED". If you see that, use modprobe and the correct module name to get it working.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
sirio81
Posts: 10
Joined: 5. Sep 2008, 14:31

Post by sirio81 »

I got it :P
I don't know why but the guest interface is simply down.
It's sufficient to take it up and configure it:

Code: Select all

ifconfig eth2 up
ifconfig eth2 192.68.0.27/24
After the last command I receive this strange message:
SIOCSIFNETMASK: Impossible to assigne the required address
but it does it: eth2 on the guest is configuer as I asked.
I tried to ping the guest (so to ping the IP assigned to vbox0) and it worked!

What do you think about this message?
Why do you think the host interface is down whene used like HIF?
Any other commet?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

Don't set the exact same IP on vbox0 Host sided and eth0 Guest sided, this will cause conflicts. If you want to ping the Guest from the Host, use the real Guest IP, not the Guest end on the Host (vbox0).
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply