Virtual machine Vmware,nat static IP configuration and access to the Internet

Source: Internet
Author: User
Tags domain name server

Although there are many articles on the Internet on the virtual machine VMware configuration static IP, but I still want to write here about NAT configuration static IP, the author but in the case of eating a big loss summed up.

First of all, as you know, the first thing to set up the virtual machine's network adapter mode is NAT mode, such as:


This is followed by a key part of the process, which is to view the configuration information of the NAT virtual network card via "edit"--"virtual Web Editor", where it is particularly important to observe the area of IP in the DHCP settings for the part of configuring the static IP Nat static IP configuration should be between the IP address, be sure to study the diagram:


If the above are all configured, you can restart the network card, it should be OK, if the network card is restarted or not, it is best to reboot a bit should be. Then the virtual machine connected to the network problem, the virtual machine through the NAT after the external can access the virtual machine through sshd, but our virtual machine at this time if not connected to the Internet what to do, such as


How can appear unknown host, we carefully recall the knowledge of the computer network we have learned, this is not representative of the domain is not resolved, it must be. Since the domain name can not be resolved does not mean that our virtual machine does not find the appropriate Domain name server (DNS), then we think about what the Domain name server (DNS) do: Resolve the domain name, return the IP address, and finally through the IP address to access the server on the network. There is a gap, since our virtual machine can not find the domain name server (DNS), the domain name can not be replaced by IP and then access the server, then if we know the domain name corresponding IP then we can access it? See:


OK, it seems we have found the problem, the next is the time to solve the problem, Ubuntu domain name resolution is configurable,Ubuntu on the configuration of the domain name is generally recommended in/etc/ Resolv.conf modified, although this file in the Ubuntu restart time empty, but in order to adapt to our virtual machine in the host access network in different ways, can make the corresponding changes, different access network may not be the same domain name server , then we will try to modify it, The modification of this file requires root permissions, how to modify, you can see:


After saving, we will ping the domain name, see if we can ping, see


Great, it's a success! Our virtual machine successfully access the network!!!

Virtual machine Vmware,nat static IP configuration and access to the Internet

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.