VirtualBox NAT host-only Advanced network Configuration

Source: Internet
Author: User

Overview: VirtualBox NAT host-only Advanced network configuration, virtual machines can either communicate with each other or surf the Internet. At the same time, add Nat way to let the virtual machine surf the net, add host-only way to let the virtual machine communicate with the virtual machine. In-depth analysis of Host-only custom segment, Windows and Linux environment, respectively, using SSH, network card naming rules. VirtualBox is installed by default and the Ubunut system is already installed in VirtualBox. 1.VirtualBox Global Settings

2. Add Nat network, add host-only network. Select the installed virtual machines (such as Ubuntu 17.04)to turn the virtual machines off.

set host-only static IP in 3.ubuntu virtual machine:

sudo vim/etc/network/interfaces
# This file describes the "network interfaces available on your system
# and" Activate. For more information, interfaces (5).

source/etc/network/interfaces.d/*

# The loopback network interface
Auto lo
iface lo inet loopback

# The Iface static IP Settings Primary Network interface (NAT)
auto enp0s3 enp0s3 inet host-only
DHCP

# (ENP0S8 is the network card name (the old rule is eth0,eth1) mapped according to the topology relationship
# can be viewed by ' ls/sys/class/net ', whether it is Enp0s8
auto enp0s8
iface enp0s8 inet Static address
192.168.56.101
netmask 255.255.255.0
The reboot configuration is in effect.

Reboot

View Virtual Machine IP

Ipconfig

At this point, complete the virtual machine and virtual machine interoperability, virtual machine and host interoperability, and can access the Internet . 4. Advanced Configuration Expansion Resolution (skip or CAN) 4.1. SSH logon operation requires the installation of Openssh-server in both the host and the virtual machine

sudo apt install openssh-server
Log into the manager virtual machine via SSH
SSH manager@192.168.56.101

4.2 Windows install SSH, use cmd or PowerShell login virtual machine

Download installation openssh for Windows, you can use SSH commands through windows. Login Agent2 virtual machine via SSH

4.3. Host-only custom network segment, host-only relevant official documents. in global settings, select Network Settings, select host-only settings, custom segment such as 192.168.88.1 in the host will have 192.168.88.1 adapter in the virtual machine to the corresponding network segment 192.168.88.xxx, such as 192.168.88.101 ifconfig (view in Linux) or ipconfig (view in Windows) 4.4. Network card naming rules

Reference Predictablenetworkinterfacenames
Word, eth0,eth1 rules are upgraded to ETH0S3,ETH0S8 with predictable topological relationships, and so on, you can view them through ls/sys/class/net

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.