Build a bridge under Ubuntu8.04

Source: Internet
Author: User
Linux Desktop is still unsatisfactory in some aspects, so it is a good choice to install a virtual machine in linux and then install a virtual windows. I used Ubuntu8.04, installed virtualbox, and installed windowsxp in virtualbox. This is a very simple process. By default, after the installation, windows and linux can access the internet. windows adopts the NAT connection method,

Linux Desktop is still unsatisfactory in some aspects, so it is a good choice to install a virtual machine in linux and then install a virtual windows.

I used Ubuntu 8.04, installed virtual box, and installed windows xp in virtual box. This is a very simple process. By default, after installation, windows and linux can access the internet. windows adopts the NAT connection method, but this method is not flexible, for other machines in the same LAN as linux, this virtual windows is invisible. In order to make the virtual windows have the same position as linux in the LAN, the following describes how to use a bridge:

1. Install the uml-utilities and bridge tools for creating a virtual network device (TAP interfaces:

$ Sudo apt-get install uml-utilities
$ Sudo apt-get install bridge-utils

2. after the preceding steps are completed, a uml-net group is automatically created. To enable your virtual machine to access network interfaces, you must add the user name of the user running the VM (usually your ubuntu Login User Name) to the uml-net user group (replace "vboxuser" with your user name "):

$ Sudo gpasswd-a vboxuser uml-net

Note: to make the change take effect, restart your computer.

3. Modify the network configuration file. My network connection is like this: multiple computers connect to the Internet through a vro in Shanghai. The vrodhcp uses dhcp to automatically assign ip addresses. The configuration method is as follows:

$ Sudo vi/etc/network/interfaces

The content is as follows:
Auto lo
Iface lo inet loopback

Auto tap0
Iface tap0 inet manual
Up ifconfig $ IFACE 0.0.0.0 up
Down ifconfig $ IFACE down
Tunctl_user anidealife

Auto br0

Iface br0 inet static
Address 192.168.1.10
Netmask 255.255.255.0
Broadcast 192.168.1.255
Gateway 192.168.1.1
Bridge_maxwait 0
Bridge_ports all tap0

Auto eth0
Allow-hotplug eth0
Iface eth0 inet manual
Up ifconfig eth0 0.0.0.0 promisc up

3. Set the network connection mode for virtual windows xp:
Select xp Network Configuration in virtual box, and select
Attached to Host Interface

In Host Interface Settings, set interface name to tap0.

4. Run the following code:

$ Sudo/sbin/ifup tap0
$ Sudo/sbin/ifup br0

Here, it will be OK. To make all the configurations take effect, it is best to restart the system.

Now linux and windows have the same position in the LAN. To enable linux and windows to access shared files, the network settings of virtual windows are the same as those in the LAN, you can run the Wizard to set up a home or a small office network. This is simple. For linux, you can install samba and configure it. There is a lot of information on the Internet. I will not go into details here.

The above is a bridge established in linux, so that virtual windows and linux have the same position in the LAN, if you install virtual box in windows and then install virtual linux, it is simpler.

The method is as follows:

1. Create a host interface in the linux network configuration of the virtual machine.

2. Select the network connection mode for the host interface you just created

3. in windows, you will see another network connection, that is, the host interface you just created. Select this host interface, press Ctrl, select your local connection, and right-click, select bridging. After a while, the bridging will be completed. You can select static ip Address allocation or dpcp allocation for your bridging network configuration, depending on your network configuration method.

After completing the above steps, your windows and linux should be able to access the Internet at the same time. At this time, they have the same status in the LAN. Next, you need to complete file sharing, install samba in linux and set up a home or small office network in windows.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.