Vmware Workstation (Centos 6.10) static IP and connect to external LAN

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))
Insert picture description here
Insert picture description here

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

Insert picture description here
Insert picture description here
DHCP address range
Insert picture description here
NAT network configuration gateway configuration is very important
Insert picture description here

4. Local computer network card configuration

Insert picture description here
Insert picture description here
Insert picture description here
Set the external network of the VM; you need to enable the allowable network link configuration; just set this one;
Insert picture description here

5. Check whether the configuration is successful

Insert picture description here
Since then, ping Baidu successfully~~We can connect to the external network. Similarly, the machine can be connected through tools such as xshell.

Guess you like

Origin blog.csdn.net/weixin_42282445/article/details/114857730