CentOS Virtual machine NAT mode is not available online

Source: Internet
Author: User

One: CentOS virtual machine nat mode cannot surf the internet

As shown below, the NIC en016777736 does not have IP information, and the ping command is reported to the network is unreachable error.

Workaround:

First, open the run and enter "Services.msc".

Locate the VMware NAT service and VMware DHCP service, right-click the VMware DHCP service, tap Stop, then turn on VMware Nat Service, and then turn on VMware DHCP service.

Open the service and turn on VMware's DHCP and NAT services in Services.msc. and modify the virtual machine access mode, you can see in the "Edit virtual network", such as

After opening as follows

VMnet0 is a bridge, VMnet1 is host-only way, VMnet8 is a NAT way, subnet IP can set itself, see 1, after the modification, you need to 2,3 the address segment corresponding to the modification.

At this time it is best to remove the other two connections except NAT to stop, will be 1 above, connect the hook off it can be

Then you need to select the NAT connection mode in the virtual machine settings, if there is no network connection, you need to add it yourself. The above methods of setting up online have many, no longer repeat.




After the network is still not available, you need to open the virtual machine to see the virtual machine networking settings. The command is as follows

#vi/etc/sysconfig/network-scripts/ifcfg-eth0

Some of the contents are as follows:

Device=eth0 #设备名称
Bootproto=dhcp #连接方式, DHCP automatically assigns addresses without having to set up IP and gateways below
hwaddr=00:0c:29:ad:66:9f #硬件地址, do not modify
Onboot=yes #yes表示启动就执行该配置, you need to change Yes

Online there will be some ways to add IP addresses, subnet masks, DNS, and so on, before the installation of these methods have been tested, and the addition of the content has also affected the Internet, so it is not recommended to use those ways to add the content.

After modifying, you need to restart the network settings, you can

# Service Network Restart

Or

#/etc/init.d/network Restart

If you are still unable to connect to the network, then go back to the physical host, see if the share of the local connection in the network connection is open, view it in the shared with properties----if there is no sharing tab, find Baidu. If the share is already open, the IPv4 and IPv6 services in Host-only Network and VMnet8 are stopped, and the front tick is removed

At this point, the virtual machine network connection is OK

Resources:

Http://jingyan.baidu.com/article/9f63fb91ab20a1c8410f0e4e.html

Http://blog.sina.com.cn/s/blog_55b497690101fgxi.html

CentOS Virtual machine NAT mode is not available online

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.