Virtualbox network ip address mutual access + host/host internet access settings

Source: Internet
Author: User

Virtualbox network ip address mutual access + host/host internet access settings
There are three types of virtualbox network connections.
NAT: hosts cannot be accessed when accessing the Internet
Host Interface: opposite to the first one, accessing the Host cannot access the Internet
Intelnal Network: build a virtual Network using all the virtual machines on the host

The first two types are commonly used.
However, for various reasons, mutual access between the Internet and the host is required. The search on the Internet adopts a dedicated approach from vmware to install two NICs on the host, one is a virtual network card. The virtual network card and the local host network card bridge are used to achieve mutual access between the Internet and the host. However, many people fail, and many people use dial-up Internet access, it cannot be set for half a day.

In fact, this is a kind of inertia of thinking. We can solve this problem in turn. We can install two NICs in the customer set, one accessing the internet, and one accessing the host using the server that implements web2.0.

Environment 1
HOST: virtualbox installation is not required.
Passenger plane: Windows ×
1: After the virtual machine is built and the system is installed, follow the settings


2: Nic 1 (Adapter 1): Select Local Connection in Host Interface mode. Do not select an error.



Nic 2 (Adapter 2): select local connection from the following options in NAT mode.

3: Start the VM.

Two local connections are displayed in the VM.



Set the ip address of one of the local connections to be automatically obtained, and set the ip address in the same network segment as the host my host ip Address: 192.168.1.254
Set ip address in Virtual Machine: 192.168.1.252
Next let's take a look at the Internet access of the passenger plane.


Yes!

Next let's take a look at the host access plane.


Yes

Environment 2
HOST: virtualbox installation is not required.
Passenger plane: Ti-server

Set two NICs in the first two
Start a linux VM
Log On with the root account or you will not be authorized
The following is a command. My system has no graphic interface
1: Check the name of the network card you just set in the system.
Ifconfig-




The names are eth5 and eth6.
So set the network
Vim/etc/network/interfaces
The settings in are as follows:
Auto lo
Iface lo inet loopback

Auto eth6
Iface eth6 inet dhcp

Auto eth5
Iface eth5 inet static
Address 192.168.1.252
Netmask 255.255.255.0
Gateway 192.168.1.1

Save

Restart the network
/Etc/init. d/networking restart

Test Internet networks
Ping www.google.com
The result is as follows:



Yes
This tutorial ends.

Related Article

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.