Vmware Workstation (Centos 6.10) static IP and connect to external LAN
I just bought a computer and wanted to install a small cluster for my laptop for my own play, so I recorded it.
1. After creating a virtual machine according to your own needs
After right-clicking the settings, select the network adapter (customize VMnet8 (NAT mode))
2. Virtual machine network card configuration-the VM uses a static address
[root@openweb ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:A0:F9:53
TYPE=Ethernet
UUID=9122cc1d-1d93-47cc-bd60-20ecd892668b
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=172.16.2.21
NETRMASK=255.255.255.0
GATEWAY=176.16.2.2
DNS1=8.8.8.8
DNS2=8.8.4.4
3. Virtual machine configuration
DHCP address range
NAT network configuration gateway configuration is very important
4. Local computer network card configuration
Set the external network of the VM; you need to enable the allowable network link configuration; just set this one;
5. Check whether the configuration is successful
Since then, ping Baidu successfully~~We can connect to the external network. Similarly, the machine can be connected through tools such as xshell.