Build a linux server virtual machine connected to the Internet using NAT, natlinux
From the very beginning, I was very entangled in the process of building a centos server.
Because I am not in O & M, but I still have to study Linux for development.
I found my own method through many aspects of exploration and learning.
First, I used centos7 and vmwar.
1. Create a new virtual machine.
2. In the centos Installation option, you cannot connect to the network after installation. I 've been struggling with what software to choose during installation.
2.1 it doesn't matter if you try to connect the network and select any software. The basic minimum installation can actually achieve network connection.
2.2 As I deployed a server that can transmit data over FTP, I chose the ftp service in the options.
2.3 it doesn't matter. I also chose a development tool, but I don't know what the feature is. I chose it as a developer.
3. In fact, there is a network connection in the interface option for installing centos. My first success was to implement it in there, where I can configure the ip address of the network connection interface.
When I use the NAT method to enable a connection, the above will show whether the connection is connected, and the allocated ip can also be displayed
3.1 sometimes the above displays a network connection error because vm-related services in the window are not enabled:
This connection tells you how to enable the Service and detailed the configuration http://blog.csdn.net/whatday/article/details/7939406 for NAT connection
3.2 The service must be enabled. The detailed NAT configuration in this article is actually configured by default by VM, As long as ipv4 in the vm8 connection under ipvs is changed to automatic connection.
4. In many cases, the above is feasible, but ifconfig will find that there is no ip Address Allocation ping command after the virtual machine is installed.
In this case, check whether the system ip address is automatically obtained.
Enter the network configuration vim/etc/sysconfig/network-scripts/ifcfg-eth0 (ifcfg-eth0 may not be needed, you can use ifconfig to see what it is)
Then look at the chart
Restart the network
/Etc/init. d/network restart
Successfully pinged wwww.baidu.com