Ubuntn Virtual Machine Nat static IP Network Configuration

Source: Internet
Author: User
Tags nameserver

Installing ubuntu12.04 on a virtual machine to automatically obtain the IP address is okay. The SSH connection is normal. After the instance is shut down and restarted, it finds that the network is disconnected.

1. Configure static IP

Gateway:

    

IP segment:

    

    

Command: Vim/etc/Network/interface

auto loiface lo inet loopback
auto eth0# Assgin static IP by eric on 26-SEP-2012iface eth0 inet staticaddress 192.168.91.200 #change to your static IPnetmask 255.255.255.0 #change to your netmaskgateway 192.168.91.2 #change to your getway#We must specify dns-nameserver here

Add DNS:

Vim/etc/resolv. conf

Add: nameserver 192.168.91.2

Restart NIC: ifdown eth0

IFUP eth0

NOTE: If/etc/init. d/networking restart or service networking restart is used, an error is prompted because the former has been discarded.

Detection Network: Ping www.baidu.com

If it succeeds, you don't need to read the following ····

However, when performing this operation, the landlord still prompts "unknown host", so he began to repeatedly check the configuration and confirm the route.

I tried to ping the gateway and found that the gateway couldn't be connected. I believe you can confirm the problem at this time. Open the network connection center and check the vm8 Nic status,

Enable DHCP and NAT service troubleshooting in the service.

        

 

This article has read the eliuhy article (http://www.cnblogs.com/objectorl/archive/2012/09/27/vmware-ubuntu-nat-static-ip-settings.html) after the problem still exists, so a little supplement to their own solution

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.