Communication with virtual machines without network cables

Source: Internet
Author: User

 

Download: http://note.sdo.com/u/634870192378852873/n/7ero9 ~ Kigocvnm36q000ij

 

First, how to configure the static IP address of ubuntu in the Virtual Machine

Run sudo VI/etc/Network/interfaces

 

Modify the IP address of a DNS server

Sudo VI/etc/resolv. conf

 

Restart the network service

Sudo/etc/init. d/networking restart

 

 

View network configurations

Ifconfig

 

2. Set the NIC connection mode of the virtual machine to Nat.

 

Step 3: Run ipcongfig in the Command window in Windows to view vmnet8 attributes

 

Attributes of vmnet8 are as follows:

Vmnet8 attributes: IP 192.168.145.1 subnet mask 255.255.0

Step 4: Set the IP address of the VM to be in the same network segment as vmnet8 (that is, the subnet mask is the same, and the IP address should be in the form of 192.168.145.xxx, where XXX is set, but it should not be 1 or 255), and then set the virtual machine's gateway and DNS Server IP address to the vmnet8 IP address, that is, 192.168.145.1.

Note:
After the above settings, no network cable is inserted, and the virtual machine can communicate with the host machine;
For example, the IP address of my host machine is configured as follows:
 

The VM can only ping vmnet8.
Whether the host machine is connected to the Internet. You can successfully ping the Virtual Machine IP address on the host machine.

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.