VirtualBox

Changes between Version 1 and Version 2 of Automatic_Bridge_Ubuntu


Ignore:
Timestamp:
Mar 19, 2007 9:32:54 AM (17 years ago)
Author:
Michael Thayer
Comment:

Fixed wiki mark-up

Legend:

Unmodified
Added
Removed
Modified
  • Automatic_Bridge_Ubuntu

    v1 v2  
    55Date: 2007/03/16[[BR]]
    66
    7 1. Introduction
     7= 1. Introduction =
    88
    99This is a quick tutorial on how to setup your Linux environment and VirtualBox,
     
    1616modem to which i connect through my eth0 port. The modem has DHCP, so i get my IP automatically.
    1717
    18 1.1 What is bridging anyway?
     18= 1.1 What is bridging anyway? =
    1919
    2020Well... I thought you would already know it (since you are reading this howto).
     
    2525
    2626One example of its use is if you have a notebook that can connect to your home
    27 computer through a wireless adapter and the home computer is also connect to the Internet (or to any other network) through a cable. To make the notebook able to access the Internet you have to options: routing[1] and bridging[2]. Both solutions will work, but if you do routing only TCP/IP packets will be able to be exchanged (ok, ok, 90% of the world uses TCP/IP but hang with me). On the other hand bridging will give you a lot more of flexibility, since now the notebook will appear is it were direct connect to the other network, just like you. Doing so the notebook can then get its own IP address with DHCP, and you (and anybody on the same network than you) will be able to exchange any packet with the notebook without any problem.
     27computer through a wireless adapter and the home computer is also connect to the Internet (or to any other network) through a cable. To make the notebook able to access the Internet you have to options: routing(ref 1) and bridging(ref 2). Both solutions will work, but if you do routing only TCP/IP packets will be able to be exchanged (ok, ok, 90% of the world uses TCP/IP but hang with me). On the other hand bridging will give you a lot more of flexibility, since now the notebook will appear is it were direct connect to the other network, just like you. Doing so the notebook can then get its own IP address with DHCP, and you (and anybody on the same network than you) will be able to exchange any packet with the notebook without any problem.
    2828
    2929What happens here is that your computer was turned in a Switch (or a HUB), and
     
    3131want to be connect to it. So what we will do here is configure a single bridge, and say that our network interface (usually eth0), and all network interfaces created by the VMs, will be connected to it.
    3232
    33 1.2 Prerequisites
     33= 1.2 Prerequisites =
    3434
    3535Before continuing the first thing you're going to need is make sure you have
     
    4444}}}
    4545
    46 2. Configuring the bridge
     46= 2. Configuring the bridge =
    4747
    4848Ok, so lets start with the fun ;)
     
    9999interface.
    100100
    101 3. Giving the needed access
     101= 3. Giving the needed access =
    102102
    103103Ok, now we need to give some permissions to devices and files. Note that, as
     
    105105hey, its for a good cause!
    106106
    107 3.1 /dev/net/tun
     107= 3.1 /dev/net/tun =
    108108
    109109First things first, to allow VBox to automatically create the virtual interface
     
    116116}}}
    117117
    118 3.2 ifconfig and brctl[[BR]]
     118= 3.2 ifconfig and brctl =
     119
    119120Besides that you (optionally) need to setuid in the "ifconfig" and "brtcl"
    120121commands. Setuid is necessary on these commands because you need to call them on the script used to configure your network, but they both need to be run as root to do what we want.
     
    132133}}}
    133134
    134 4. The scripts
     135= 4. The scripts =
    135136
    136137Now that everything is in place lets configure the scripts that will be called
     
    171172password only once.
    172173
    173 5. Wrapping it up
     174= 5. Wrapping it up =
    174175
    175176Well, thats it! Quite easy huh?  Now all you need to do is create and virtual machine, go on its "Network" options, change the "Attached to" to "Host Interface", give the Interface a name (each machine should use a different interface!), and point the "Startup Application" and "Terminate Application", to your TapUP and TapDown files.
     
    177178I've tested it with a Windows guest, and everything worked like a charm.
    178179
    179 6. Thanks
     180= 6. Thanks =
    180181
    181 7. Changelog
     182= 7. Changelog =
    182183
    1831840.1 -> Initial version
    184185
    185 8. References
     186= 8. References =
    186187
    187 [1] http://en.wikipedia.org/wiki/Routing[[BR]]
     188[1] http://en.wikipedia.org/wiki/Routing [[BR]]
    188189[2] http://en.wikipedia.org/wiki/Bridging_%28networking%29

© 2023 Oracle
ContactPrivacy policyTerms of Use